Squid3 reverse proxy installation and configuration basic tutorial

  
 

First, compile and install

Download

#wget http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE25.tar.gz //Find the address #tar zxvf squid-3.0.STABLE25.tar.gz //Stable version #cd squid-3.0.STABLE25

#./configure --prefix=/usr/local/squid //Must


//The following steps are optional

--enable-arp-acl /--enable-linux-netfilter /--enable-pthreads /--enable -err-language="Simplify_Chinese" /--enable-default-err-language="Simplify_Chinese" /--enable-underscores /--disable-internal-dns /--enable-pf-transparent /--enable -referer-log


//Compile must

#make#make install

Note:--enable-internal-dns Do multiple websites Used when reversing the proxy, allowing the use of internal dns, or changing /etc/hosts================================ =================================================================###################################################

#mkdir /usr/local/squid/var/cache

#mkdir /usr/local/squid/var/logs

#chown -R squid:squid /usr/local /squid/var/cache //default nobody transport Line

#chown -R squid:squid /usr/local/squid/var/logs

#squid -z //Initialize the cache directory #squid -zX to view the initialization process

If you can't use it. /squid -z

In /etc/hosts: Add internal DNS resolution, for example:

192.168.1.65 www.squid.com



#whereis squid #You can see where Squid's main files are loaded




Four, create a cache directory

#/usr/local/squid/sbin/squid –z

//To see the command line to create a cache under 00 01 and other directories Successful

Start Squid

#/usr/local/squid/sbin/squid start


Reload Squid

# /usr/local/squid/sbin/squid restart

Stop squid:

#/usr/local/squid/sbin/squid -k shutdown

Start with new configuration :

#/usr/local/squid/sbin/squid -k reconfigure


Truncate/round-robin log at 0:00 per day via crontab:

0 0 * * * (/usr/local/squid/sbin/squid -k rotate)


You can use the following command to find the cached file

#cd /Usr/loc Al/squid/var/cache

#find -type f

Copyright © Windows knowledge All Rights Reserved