設置Squid的目的當你在企業內部,Internet斷掉的狀況下,你能夠默認路由走別的路徑出去,好比從Squid 所在網絡出口出去bash
Part 1. restart the squid service 網絡
the squid path is working in /usr/local/squid/sbin/squid
Configuration file /usr/local/squid/etc/squid.conf ide
sudo ./squid -s <--- start the process
sudo ./squid -k reconfigure <----to reload the procesui
Part 2, Setup the squid on Redhat this
1 . Linux system with gcc compiler and yum functiongoogle
sudo ./configure sudo make sudo make installrest
add acl local src 135.36.0.0/16
*Adapt localnet in the ACL section to list your (internal) IP networksorm
from where browsing should be allowed
http_access allow localnet
http_access allow localhost
#*And finally deny all other access to this proxy
http_access deny allserver
#*Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /usr/local/squid/var/cache/squid 100 16 256
cache deny all <--- do not use cache mode crontab
change the /usr/local/squid/var to 777, so nobody account can read and
write log to
/usr/local/squid/var/logs/
sudo chmod -Rvf 777 /usr/local/squid/var
shutdown the firewall, sudo service iptables stop and sudo chkconfig
iptables off
and make sure the firewall allow network to communication with this DMZ
zone server
#!/bin/sh
#This script will be executed after* all the other init scripts.
add cron job to nobody account so to rotate the log
sudo crontab -u nobody -e
0 4 * /usr/local/squid/sbin/squid -k rotate <--- add this line
sudo ./squid -s <--- start the process
9.
/usr/local/squid/bin/squidclient -p 8000 http://www.google.com <----test ifsquid is working