++++++++++++++++++++++++++++++++++++
How To Install Squid in Ubuntu Linux
1. Install & Configure Squid
First login as root.
a) Then install squid:
apt-get install squid
b) configure:
* gedit /etc/squid/squid.conf
o change squid port: from http_port 3128 to http_port 8080
o find the http_access section, uncomment the following 2 lines and add your own networks (for example 192.168.0.0/24):
acl our_networks src 192.168.0.0/24
http_access allow our_networks
o change hostname in the visible_hostname section after:
#Default: # none hota hay, just add:
visible_hostname localhost # or any other valid hostaname
c) restart squid:
service squid restart
Configure Squid as Transparent Proxy (Squid version >= 2.6)
* gedit /etc/squid/squid.conf
o change from: http_port 3128 to,
http_port 3128 transparent
o add line:
always_direct allow all
* add this line to iptables:
o iptables -t nat -A PREROUTING -i eth0 -p tcp – -dport 80 -d ! 192.168.0.0/255.255.0.0 -j REDIRECT – -to-port 3128
+ + -i eth0 – adjust to the interface where it will be listening
+ + -d ! 192.168.0.0/255.255.0.0 – excludes this address range from caching
* save the new iptables:
iptables-save
++++++++++++++++++++++++++++++++++++
Leave a Reply