Thursday, September 23, 2010

SQUID PROXY SERVER

WHAT IS PROXY SERVER ?

       - Proxy Server controls client computer's access to Internet.
       - It blocks the users from accessing undesirable websites.
       - It hides the inteernal identity of a network
       - It is generally used to share internet from one machine to other client machines.
       - It improves performance by storing webpages locally.
       - It is opensource

SQUID PROXY SERVER

- Squid is an internet object cache that can act as proxy serverr for http,ftp etc.
- Clients request URLs from squid which then serves the cached copies of the URLs if they have been previously requested.

SQUID AS HTTP ACCELERATOR -

Squid makes URL requests on be half of a client when it acts as a proxy & it serves the URL requests on be half of a server when it acts as an accelerator.

        * Squid on behalf of a client ---> Proxy
        * Squid on behalf of a Server ---> Accelerator

SQUID PROXY CAN BE CONFIGURED AS -

    1.  A simple Proxy shared server
    2. A caching Web server
    3. A Firewall

SERVICE PROFILE

  Daemon - /urs/sbin/squid
  Script    - /etc/init.d/squid

SQUID SERVER INSTALLATION & CONFIGURATIONS -

[INSTALLATION OF RPM PACKAGE THROUGH YUM]

# yum install squid*
it will install squid rpm with necessary dependencies installed.

# chkconfig squid on
# vi /etc/squid/squid.conf

Go to line No - 73 or search for "http_port"
Replace the port with a new number if you want. By default the 3128 port will be found set for squid.

:wq - write and quit to save your squid configuration file

# service squid restart

Now a squid proxy server with port number as defined in the configuration file is ready to be used.



Then search for the term "INSERT"
or line number 2522

 HOW TO TEST YOUR SQUID SERVICE WORKING OR NOT ?

Go to a system. open browser. set the proxy by giving the ip address & port number as defined for your squid proxy server.

Then try to access internet. Check if that comes or not. [ it depends on the restrictions you make ]

HOW TO SET PROXY ON CLIENTs ?

- Open Mozilla Firefox
- Edit -- Preferences
- General Tab -- Connection Settings
- Maual Proxy Setting
- Http Proxy -- Proxy server ip address
- Proxy Port No -  Give the port number
- Ok

SQUID PROXY SETTING ON CLIENT THROUGH COMMAND MODE -

# export squid_proxy=http://squidserverip:squidport

HOW TO DEFINE RULES IN SQUID ?

# vi /etc/squid/squid.conf

Search for a term "INSERT" or go to line number 2522 [ Line number may vary version to version]

Then insert rules of your own as below -

# ACL Restricting KURTAPAIJAMA.COM from being accessed by clients

acl  Jhakass url_regex kurtapaijama.com
http_access deny Jhakass
[ Jhakass is the acl defined]

So kurtapaijama.com won't be accessible to users connected to internet through this proxy server.

# ACL allowing users on systems from the subnet 192.168.0.0/24 to internet.

acl BBDM src 192.168.0.0/24
http_access allow BBDM

[BBDM (Stands for Bad Boys Dirty Minds) is the acl name]

No comments:

Post a Comment