1
What is Proxy Server ?
Proxy Server controls client computer s access to the Internet. It blocks the users from accessing undesirable websites and hides the internal identity of the network. It improves performance by storing webpages locally. It is generally used to share internet from one machine to several clients. Squid Proxy is widely used as Proxy because it provides many features & is an open source.
2
Squid Proxy Server
Squid proxy can be configured as :A Simple Proxy (ie to share server) A Caching Web Server A Firewall
3
How Proxy Server works ?
Proxy Proxy www.yahoo.com www.yahoo.com Server Server Web WebPages Pages 192.168.0.253 192.168.0.253
Linux Linux Client Client 192.168.0.1 192.168.0.1
Cached Cached
r fo st com .1 e . qu o .0 re ho 168 253 eb w.ya 92. 8.0. m W w :1 16 ro m 3 w om 92. y f .co .25 l p o 0 Fr : 1 Re ho 68. 0.1 To eb w.ya 92.1 68. W w 1 2.1 w m : 19 o : Windows Fr To
Web Request for www.yahoo.com From : 192.168.0.253 To : 210.10.152.15 Web Reply from www.yahoo.com From : 210.10.152.15 To : 192.168.0.253
www.yahoo.com www.yahoo.com
210.10.152.15 210.10.152.15
Client Client
192.168.0.2 192.168.0.2
4
How Proxy Server works ?
Proxy Proxy www.yahoo.com www.yahoo.com Server Server Cached Cached Web WebPage Page
192.168.0.253 192.168.0.253
192.168.0.1 192.168.0.1
for st m ue .co .2 eq oo .0 b r ah .168 .253 We w.y 192 68.0 ww m : 2.1 o F r : 19 m fro om 3 To 5 ly ep oo.c .0.2 b R ah 168 0.1 We w.y 92. 168. ww m : 1 192. o : Fr To
Linux Linux Client Client
www.yahoo.com www.yahoo.com
210.10.152.15 210.10.152.15
Windows Client Client 192.168.0.2 192.168.0.2
5
Requirements
Packages squid-2.5.STABLE6-3.i386.rpm Port Numbers 3128
(default)
Configuration File /etc/squid/squid.conf Service squid Daemon squid
6
Proxy Server Configuration
Proxy Proxy Server Server 192.168.0.253 192.168.0.253 www.yahoo.com www.yahoo.com
210.10.152.15 210.10.152.15 Linux Linux Client Client 192.168.0.1 192.168.0.1
Windows Client Client 192.168.0.2 192.168.0.2
7
Configuring Proxy Server
Install Installthe thepackage packageby byusing usingone oneof ofthe theinstallation installationmethods methods [root@comp1~]# mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ [root@comp1~]# mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ /mnt /mnt [root@comp1 [root@comp1~]# ~]#cd cd /mnt /mnt [root@comp1 [root@comp1~]# ~]#rpm rpm -ivh -ivh squid* squid* --force --force --aid --aid
Open Openconfiguration configurationfor forediting editing [root@comp1~]# vi /etc/squid/squid.conf [root@comp1~]# vi /etc/squid/squid.conf
8
/etc/squid/squid.conf
To Tochange change the theoptions options http_port http_port 3128 3128 cache_dir ufs cache_dir ufs/var/spool/squid /var/spool/squid100 10016 16256 256 visible_hostname visible_hostname linux-squid linux-squid acl our_networks src acl our_networks src192.168.0.0/24 192.168.0.0/24 acl aclbusiness_hours business_hourstime time SS M MTTW WH HFFAA 09:00-17:30 09:00-17:30 acl acltest testurl_regex url_regex www.yahoo.com www.yahoo.com http_access http_access allow allow our_networks our_networks business_hours business_hours test test
9
Proxy Server
To Torestart restartthe theProxy Proxyservices services [root@comp1 ~]# service squid restart [root@comp1 ~]# service squid restart
10
Configuring Proxy Client - Linux
Configuring ConfiguringProxy ProxyClient Client [root@comp1 ~]# elinks [root@comp1 ~]# elinks
Text TextMode Mode
In InElinks Elinkswindow window Go to Setup menu and Select Options Go to Setup menu and Select OptionsManager Manager .. In Inthe the Protocols Protocols,,select selecton on Http Http.. Select Selectthe the Proxy ProxyConfiguration Configuration option. option. In Host and port number , select In Host and port number , select Edit Edit.. Type Type Proxy ProxyIP IPaddress address and and Proxy ProxyPort PortNo. No. Then select Save and OK . Then select Save and OK . Close Close
11
Configuring Proxy Client - Linux
Configuring ConfiguringProxy ProxyClient Client--Graphically Graphically Open Mozilla / Firefox . Open Mozilla / Firefox . Go Goto to Edit Edit menu menuand andSelect Select Preferences Preferences .. In Inthe the General General,, click clickon on Connection ConnectionSettings Settings.. Select the Manual Proxy Configuration Select the Manual Proxy Configuration option. option. In the Http Proxy box, type Proxy IP address In the Http Proxy box, type Proxy IP address In Inthe the Http Httpproxy proxy Port Port box, box,type type Proxy ProxyPort PortNo. No.
12