2013-08-31

How to configure basic squid proxy server

Hi all, as title says everything today we are gonna configure basic squid proxy server.this is very basic,well many of you are thinking why we should use Squid, thire is alot of  free proxy.Well squid is often used in small or big office or company. squid also act like firewall, you can restrict access,block sites,block user from connecting to your network.in simple word you can manage your internet traffic easily by using squid.squid is also use as caching server.

what is squid caching server?

In simple word in  office there is 2 user A & B. and both is connected to internet using squid proxy from same network. so when user A visit to google.com. squid also save result into  cache memory. so when user B try to visit google.com then google.com open very fast. coz he get it form cache.so it's provide speed,
So after littel intro to squid let configure it.

I assume that you have vps.you can use any linux based os. i am going to install squid in my own vps & i have centos 6.

1. Connect to your vps using ssh client putty,Zoc etc.. i recommend Zoc.

2.  Type below command  for install squid package.

     yum install squid -y

 in ubuntu use below command

   apt-get install squid -y

wait for few second till you see completed. ok so now we installed squid package successfully.

3.Now it's time to configure squid .so go to squid configuration file and make changes.
configuration file path is /etc/squid/squid.conf

4. Use your fav editor nano,vi,vim etc mine is vim. so edit config file as below.

  vim /etc/squid/squid.conf




After you open config file you will see following  configuration options. Well we dont have to touch
whole config we will do only required changes for this basic squid setup.

4. in vi or vim editor press "i"(insert mode) key in your keyboard for enable editing mode  and now you can do changes. Now go to Acl section and add below line.

http_access allow all




5. Now we will change port number which we want to listen squid proxy. default is 3128. if you want to run squid on 8080 or any other port then you can change it as given in below screenshot.


                                        

Note: If you are going to use 8080 port then this port should be free and not used by any other application.

Alright so you are almost done with your basic setup now one things remain. we have to set host name. So first check what is your server hostname, using "hostname" command without quotes. mine hostname is David so i will use it in my squid config .let set hostname in squid config.Hostname option will not be given in config by default. so you have to append below line to end of your config as below.

visible_hostname David (ofcourse replace your own hostname in place of David)

                                    


6. Now press "Esc" then ":" then "wq"  without quotes for save config file.

Ok so we are done with basic editing now start squid service using below command.

service squid start
        or

/etc/init.d/squid start



If your service succesfully started then it will say "ok"

 and use "chkconfig squid on" command for run squid service on every boot.

Now go to your brower and check mark manual proxy option and put squid server ip and port. if you dont know ip address then type "ifconfig" command without quotes and get your ip. your system ip will be your squid ip .

So we are done with basic setup of squid. hope it will help you.


This post credit goes to AR AR bhai ji (Team Indishell member)







Share this post

1 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

© 2009 Start With Linux | Mannu Linux
Designed by cyb3r.gladiat0r
Posts RSSComments RSS
Back to top