|
by D.S. Oberoi <ds_oberoi/at/yahoo.com> About the author: D.S. Oberoi lives in Jammu, India and has currently problems to connect to the internet due to the ongoing political tentions. |
Setting up a Squid-Proxy ServerAbstract:
Linux has become a synonym for Networking. It is being used both
in office and home environments as file, print, e-mail,
application server and also it is increasingly being used as
Proxy server. |
rpm -q squidThe latest version of Squid can always be obtained from the Squid Homepage and other mirror sites. Squid can be installed on the desired system by using the following rpm command:
rpm -ivh squid-2.3.STABLE4-10.i386.rpm
http_port 192.168.0.1:8080
With above declaration Squid is bounded to the IP address of 192.168.0.1 and port address of 8080. Any port address can be given; but make sure that no other application is running at set port value. With similar configuration lines other service's request ports can also be set.acl acl_element_name type_of_acl_element values_to_acl
Note :acl mynetwork 192.168.0.1/255.255.255.0
http_access allow mynetwork
service squid start
Note :acl allowed_clients src 192.168.0.10
192.168.0.20 192.168.0.30
http_access allow allowed_clients
http_access deny !allowed_clients
acl allowed_clients src
192.168.0.1/255.255.255.0
acl regular_days time MTWHF 10:00-16:00
http_access allow allowed_clients regular_days
http_access deny allowed_clients
acl hosts1 src192.168.0.10
acl hosts2 src 192.168.0.20
acl hosts3 src 192.168.0.30
acl morning time 10:00-13:00
acl lunch time 13:30-14:30
acl evening time 15:00-18:00
http_access allow host1 morning
http_access allow host1 evening
http_access allow host2 lunch
http_access allow host3 evening
http_access deny all
http_access Action statement1 AND staement2 AND statement OR.
multiple http_access statements are OR'ed whereas elements of an access entries are AND'ed together; due to this reason thehttp_access allow host1 morning evening
would have never worked as time morning and evening (morning AND evening ) would never ever be TRUE and hence no action would have taken place.acl allowed_clients src
192.168.0.1/255.255.255.0
acl banned_sites url_regex abc.com *()(*.com
http_access deny banned_sites
http_access allow allowed_clients
acl allowed_clients src
192.168.0.1/255.255.255.0
acl banned_sites url_regex dummy fake
http_access deny banned_sites
http_access allow allowed_machines
acl allowed_clients src
192.168.0.1/255.255.255.0
acl banned_sites url_regex "/etc/banned.list"
http_access deny banned_sites
http_access allow allowed_clients
acl mynetwork 192.168.0.1/255.255.255.0
acl numconn maxconn 5
http_access deny mynetwork numconn
acl cache_prevent1 url_regex cgi-bin /?
acl cache_prevent2 url_regex Servlet
no_cache deny cache_prevent1
no_cache deny cache_prevent2
acl allowed_clients src 192.168.0.1/255.255.255.0
acl banned_sites url_regex abc.com *()(*.com
http_access deny banned_sites
deny_info ERR_BANNED_SITE banned_sites
http_access allow allowed_clients
cache_access_log For access.log cache_log For cache.log cache_store_log For store.log (Store manager) pid_filename Squid process ID file name
acl pass proxy_auth REQUIRED
acl mynetwork src 192.168.0.1/255.255.255.0
http_access deny !mynetwork
http_access allow pass
http_access deny all
Webpages maintained by the LinuxFocus Editor team
© D.S. Oberoi "some rights reserved" see linuxfocus.org/license/ http://www.LinuxFocus.org |
Translation information:
|
2005-01-14, generated by lfparser_pdf version 2.51