LINUX Study Notes-Proxy Server Settings

Source: Internet
Author: User
Tags squid proxy
Article Title: LINUX Study Notes-proxy server settings. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. Proxy Server Overview
  
The proxy server allows multiple computers without IP addresses to use its proxy function to quickly and securely access Internet resources. The current Server Client sends an external resource access request, which is first identified by the proxy server and requested by the proxy server. Generally, the proxy server has a high bandwidth and performance, and can intelligently cache the browsed or unbrowsed website content. Therefore, under certain circumstances, the client can access network resources more quickly through the proxy server. Common examples of proxy server applications: a LAN with hundreds of computers can access the Internet through a proxy server that can access external network resources.
  
II. Introduction to SQUID Software
  
The software that can make a common computer a proxy server is called the proxy server software. The famous one is Microsoft's MS PROXY2.0 (now renamed ISA. NET), WINGATE, SYGATE, netscape proxy server, and free SQUID for LINUX.
  
SQUID is the most popular agent server software in Linux. It has powerful functions: it supports proxies for HTTP, FTP, GOPHER, SSL, WAIS, and other protocols. The setting is simple: you only need to modify one of the configuration files to make the Proxy Server Run.
  
3. settings of SQUID Proxy Server
  
Purpose: To configure a RedHat Linux7.0 computer to become a proxy server for all network segments. Note: considering that it is the first time to contact the SQUID software, for convenience, the following installation process is carried out as root.
  
Step 1: Download, compile, and install the SQUID Software
  
Download the squidsoftware from www.squid-cache.org. Take the stable squid-2.4.stable1-src.tar.gz as an example. Run tar zxf squid-2.4.STABLE1-src.tar.gz to generate the squid-2.4.STABLE1 directory. Because the SQUID operation requires the nobody user and the nobody group, you must first run the Linuxconf command to check whether the user and group exist. If not, create a user group. Go to the "squid-2.4.STABLE1" directory and run ". /configure -- prefix =/usr/local/squid "; after completion, Run" make all "; after completion, Run" make install "to install the software. So far, squid has been successfully installed in the/usr/local/squid directory.
  
Step 2: configure the SQUID Software
  
1. Set "chmod 777/usr/local/squid/logs" to writable. In this way, unspecified SQUID proxy customers can access the proxy server normally and generate files such as access. log and cache. log in the logs directory.
  
2. "/usr/local/squid/bin/squid-z", and manually create the squid cache directory/usr/local/squid/cache.
  
3. Modify the SQUID configuration file squid. conf. SQUID configuration files have a total of 125 configuration items, but for general web cache proxy server, you only need to modify several configuration items. Edit the/usr/local/squid/etc/squid. conf file, find "http_access deny all", and change "http_access allow all" to allow all computers to access Internet resources through proxy services. As long as this item is used, the SQUID service can be started.
  
4. "/usr/local/bin/RunCache" to start the squid proxy service.
  
If there are no 1 and 2, run the RunCache script and check the/usr/local/squid/cache. log File to see the relevant error information.
  
Step 3: Set the client and test the proxy service
  
Run IE on another win98 computer (taking Internet ipve5.0 as an example), click "Tools", click "Internet Options", and then click the "connection" tab, click LAN Settings. In the LAN Settings window, enter the IP address of the SQUID server in the address field, fill in "3218" in "Port" (the default proxy Port Number of SQUID software), and then exit. Next, you can view access. log and cache. log under logs to see if the agent runs normally.
  
4. Others
  
1. cache_mem: Set the memory size used by the proxy service. Generally, 1/3 of the physical memory is recommended.
  
2. cache_dir: Specify the cache directory path. The default value is/usr/local/squid/cache.
  
3. http_port: the port number used by the proxy service. The default value is 3128. You can use another port, but pay attention to two points: 1. The port used cannot be the same as other services; 2. Run SQUID as root when using a port lower than 1024.
  
4. There is a script cachemgr under/usr/local/libexec. cgi: copy it to your Web cgi-bin directory (the default web root is/var/www after Apache is installed) and run it in a browser, you can access some web-based management.
  
V. Conclusion
  
To fully play SQUID functions, just understand those above is far from enough; you should often go to SQUID home www.squid-cache.org to see, in order to go to the next floor.
  
  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.