Centos6.5 squid installation, centos6.5squid
Squid acts as 1 forward to the proxy standard Proxy Buffer server. The IP address and port number of the proxy server must be specified in the browser of each internal host. Transparent Proxy Buffer server, proxy operations on the client browser is transparent (that does not need to specify the Proxy Server IP address and port) Iptables or Ipchains implementation reference http:// OS .51cto.com/art/201404/435129.htm 2. squid optimizes the architecture, caches the website, and improves the web application access performance. When squid receives a request for a special resource for the first time, squid often confirms it from the original server. If the server indicates that the copy of squid is still valid, the data will be sent out. Otherwise, squid upgrades its cache copy and forwards it to the customer. Squid clears the cache to release space for new objects. Workflow:. the client sends a data request to the proxy server. the proxy server checks its own data cache. c. the proxy server finds the data you want in the cache and retrieves the data. d. the proxy server returns the data obtained from the cache to the client. When the current server does not have the data required by the Client: 1. the client sends a data request to the proxy server. the proxy server checks its own data cache; 3. the proxy server does not find the data the user wants in the cache; 4. the proxy server sends data requests to remote servers on the Internet. the remote server returns the response data. 6. the proxy server retrieves data from the remote server, returns the data to the client, and keeps a copy of the data to its own cache. For details, refer to: slave. More disk space means more cache targets and higher hit rates. SCSI disks have better performance than ATA. The basic rule is that each GB of disk space requires 32 MB of memory. In this way, the 30% M memory system can support 16 GB disk cache. The typical cache hit rate of Web cache is between 60% and squid. Install the operating system centos6.5squid: the squid-3.1.23-24.el6.x86_64.rpm3.1 checks whether rpm-qa squid3.2 yum-y install squid is currently installed. configure the directory structure main program after installing 4.1:/usr/sbin/squid Script:/etc/init. d/squid configuration file/etc/squid. conf default access log file:/var/log/squid/access. log 4.2squid.conf file configuration vi/etc/squid. conf configure http_port 192.168.252.11: 3164 # listener port (for security reasons, add an IP address to the front, Squid will not listen to external network interfaces) ca Che_dir ufs/var/spool/squid 100 16 256 // defines the squid cache storage path. The cache directory capacity is 100 mb. The cache directory contains 16 first-level cache directories, there are 256 second-level cache directories-you must add the following statement at the bottom of the configuration file; otherwise, squid cannot be started! Visible_hostname localhost -- configure some IP addresses to access acl normal src 192.168.101.1-192.168.101.250/32http_access allow normal # cache access_log/var/log/squid/access. log Setting access log file # cache store_log/var/log/squid/store. log set the webpage cache log file # cache valid tive user/group squid 5. start -- create the cache directory cd/usr/sbin/squid. /squid-z2017/06/30 15:13:54 | Creating Swap Directories2017/06/30 15:13:54 |/var/spool/squid exists2017/06/30 15:13:54 | Making directories in/var/spool/squid/002017/06/30 15:13:54 | Making directories in/var/spool/squid/012017/06/30 15:13:54 | Making directories in/var/spool/squid/022017/06/30 15:13:54 | Making directories in/var/spool/squid /032017/06/30 15:13:54 | Making directories in/var/spool/squid/042017/06/30 15:13:54 | Making directories in/var/spool/squid/052017/06/30 15:13:54 | Making directories in/ var/spool/squid/062017/06/30 15:13:54 | Making directories in/var/spool/squid/072017/06/30 15:13:54 | Making directories in/var/spool/squid/082017/06/30 15:13:54 | Making directories in/var/spool/squid/092017/06/30 15:13:54 | Making directories in/var/spool/squid/0A2017/06/30 15:13:54 | Making directories in/var/spool/squid /0B2017/06/30 15:13:54 | Making directories in/var/spool/squid/0C2017/06/30 15:13:54 | Making directories in/var/spool/squid/0D2017/06/30 15:13:54 | Making directories in/ var/spool/squid/0E2017/06/30 15:13:54 | Making directories in/var/spool/squid/0F iptables corresponding configuration if the proxy is normal, you need to configure the iptables NAT table, forward access to port 80 to the squid port iptables-t nat-a prerouting-s specified ip segment-p tcp -- dport 80-j REDIRECT -- to-port 3164 if it is not required by A transparent proxy develop the squid port iptables-a input-s to specify the ip segment-p tcp -- dport 3164-j ACCEPTiptables-a output-p tcp -- dport 3164-j ACCEP