Industry guru Dave Taylor offers tech support on technical and business topics, including iPhone, iPod, Microsoft Windows, Sony PSP, cellphones, online advertising, CSS, Web design, business, Unix, Linux, SEO, Mac OS X, and shell script programming.     


Configuring Squid as a Linux Proxy Server?

Dave, I am running an Internet Café in which I have about 10 workstations and one server. Now I am planning to configure a proxy server on LINUX for my cafe to improve performance in browsing. For this I have installed Complete REDHAT 9.0 in a machine equiped with 1.3G RAM, 80GB HDD, 1GHz MP, Intel P4, plus 2 NICs (Real Tech). But I have no idea about how to configure PROXY on it. Kindly let me know about any links or tutorial which can help me in a jumpstart. I do not want to mess with linux deeper. I just want to sonfigure PROXY and that is it.


Dave's Answer:

Great to hear about your Internet Café! I'm unsurprised to hear that you're finding it a bit tricky to configure a public Internet access facility to simultaneously offer good connectivity and security, however.

Since I'm not an expert at configuring proxy servers within the Linux world, I asked a couple of my colleagues at LinuxWorld Magazine for their suggestions, and here's what they shared:

Steve Suehring suggested: that you start with Squid, a popular Linux proxy server. You can learn more about Squid at http://www.squid-cache.org/. Pay particular attention to the Squid Quick Start Guide, and if you really want to learn all the ins and outs, the book Squid: The Definitive Guide is apparently excellent.

Steve also notes that you can block banner ads automatically, a great service to your customers, by installing Adzapper. (of course, some folk would say that you're doing your customers a disservice by blocking any Internet content, so you'll have to make your own judgment call on this one).

Martin C. Brown also asked that I point you to his excellent article on Configuring Apache as a Proxy Server for ServerWorld. It's well worth reading if you want to just sidestep Squid and the required configuration steps.

Either way, I think that should get you moving in the right direction. Good luck setting up your café and please do let me know if I can assist as you proceed further.


More Useful Unix and Linux Help Articles:
✔   Copy and Paste from the Mac OS X Command Line?
I am constantly running commands in Terminal.app on my MacBook and then copying and pasting the results into email messages or documents. Yes,...
✔   Shell script to convert lowercase to title case?
As part of a project I'm working on, I find myself deep in a Linux shell script, needing to have a subroutine that...
✔   Can I script renaming files based on an XML data map?
I have a folder full of files which are named with four digits and a file extension e.g. 0312.file and an XML-file describing...
✔   Test for valid numbers in a Bash shell script?
In a different discussion on this site [see Redirecting input in a shell script] a visitor commented that "I was too busy trying...
✔   Review: iSSH for the iPad/iPhone
If you're running an online business like I am, there are times when you need to connect and log in to the server...

Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
    Enter your name: and your email addr:  









Reader Comments To Date: 68

Stewart Vardaman said, on March 4, 2005 6:21 AM:

We use Squid at work. As to the AdZapper thing, we incorporate the HOSTS file at:

http://www.mvps.org/winhelp2002/hosts.htm

as one filter set. Nice thing is a lot of those entries at MVPS are known spyware sites, which saves the IT folk later headaches if we block them to begin with.

The file gets updated regularly. But it doesn't quite match Squid's config files, so I did a simple script to convert it for Squid use.

We keep a whitelist that compares against the MVPS list. Those guys block some sites (certain Overture domains, for example) that our marketing department actually needs to visit. With the whitelist we can largely automate the benefits of the MVPS file without hampering legit usage.

Pa Sara Drammeh said, on August 2, 2005 11:44 AM:

I am working as a Network Administrator at the University of the Gambia.. We ahve a new server and I want to install Linux as a both internet and file server, and host our own website but i have no idea on linux... we have 64 PCs

anonymous said, on September 16, 2005 1:43 PM:

Squid's own squidguard can block ads, among other things (except ultraviolet rays). No need for a separate program.

nitin said, on March 16, 2006 6:00 AM:

I am working with SCMLD.Pune. we have 110 desktop and three server. two is windows 2000 & one is Linux but i have to configure squid & sendmail on linux 9.0 ver. Please late me know How i am going to configure this two option.
Thank You.

bob said, on April 28, 2006 9:48 AM:

ok i want to know how to use a proxy at school if it's blocked... i used to use it all the time but the school caught on and now i want a way to be able to go to blocked sites without having to download anything or having to take hours just to get somewhere.. can you help me?

Dave Taylor said, on April 29, 2006 2:22 PM:

Bob, dare I say it: maybe you need to just live within the rules at school rather than keep trying to find ways to circumvent it?

ramesh said, on January 11, 2007 5:55 AM:

nothing

Rizky said, on February 8, 2007 1:12 PM:

Mr. Dave! I am running an Internet Café in which I have about 10 workstations and one server (Squid - Installed).

Would you tell me how to block the adv. banner using squid!

And now, I tried to block the adv. ip addreses (prohibit bla.bla.bla.bla)!
But, the page is look not good!

Appears: "Hostname bla.bla.bla.bla cannot found".

I'm going mad now!


Thx Before!

sanjeev said, on February 28, 2007 11:20 PM:

can we block some websites on redhat linux 9.0 without using squid proxy.

Mir Hassni said, on March 25, 2007 7:08 AM:

I am using ubuntu 5.10
how i am configure my squid server in ubuntu 5.10 i installed squid but i am not configure this Please if any one help me

amardeep said, on April 9, 2007 2:49 AM:

sir i am working as technician in some institute. we have 40 computers on net and one server. on we have install linux verson 4.0. and other pcs are installed windows xp service pack 2 . i wants to block some chating sites and adults sites. please help me how we can block the sites using the proxy server.

dogra said, on April 16, 2007 1:38 AM:

dear sir

i am working as system admin and i want to configer firewall i want that wan user can access my network only port 8080 and other all port should be block but i dont hav idea so ple help me

Imran said, on April 28, 2007 9:53 AM:

Yes dear y everyone is worry about squid and linux server.. it is the most easiest and reliable operating system in this world. if you want to configure a squid and otherthings in linux and you peoples are new to linux.. try this one ipcop.org first. it is easy and predefined server which is ready to work with in 15minutes.

if you peoples are having problem in this you can ask me anytime on my email.

dudemjk said, on May 24, 2007 7:32 AM:

Ubuntu server 7.04 is release with easy squid proxy installation. Try it.

pradeep yadav said, on July 8, 2007 10:38 PM:

How configure squed in linux please now send me massege about linux squed

tanveer said, on July 24, 2007 12:03 AM:

Squid Server configuration

Squid uses the configuration file squid.conf. It is usually located in the /etc/squid directory. Access through the proxy can be given by individual IP addresses or by a subnet of IP addresses.
In squid.conf search for the default access control lists(acl) and add the following line below them:
acl mynetwork src 192.168.1.0/255.255.255.0 (for subnet)
acl mynetwork src 192.168.1.10/255.255.255.0 (for individual IP)

Then add the access control list named "mynetwork" to the http_access list with the following line:
http_access allow mynetwork

The default port for the proxy is 3128. Uncomment the following line and replace 3128 with the desired port :

http_port 3128


After configuration Restart this service

Assuming you have the runlevel scripts installed you can use the following commands as root:


Start squid /etc/rc.d/init.d/squid start
Restart squid /etc/rc.d/init.d/squid restart
Stop squid /etc/rc.d/init.d/squid stop


or issue the following TWO commands as root:
squid -z
squid

or configure squid to start at boot time using your runlevels.

troubleshooting: [do this on the proxy server]

'tail -f /var/log/messages' in a seperate bash window while restarting squid
'tail -f /var/log/squid /access.log' in a seperate bash window while
attempting connections to the proxy server. watch the output for
success & failure.

amit said, on August 8, 2007 5:11 AM:

sir
i am working as technician in some institute. we have 400 computers on net and one server. on we have install linux verson 9.0. and other pcs are installed windows xp service pack 2 . i wants to block some chating sites and adults sites. please help me how we can block the sites using the proxy server.

Nandhakumar said, on January 25, 2008 5:45 AM:

Hi sir

I am working as a system support team in my company we have windows client machines 200nos. and they are accessing internet but we want to ban unwanted sites
how can we configure the proxy and how can we apply the policies plz tell me step by step.

Thanks
Nandha

Prashant Tomar said, on February 13, 2008 3:37 PM:

Hello,

All you need is to install CentOS, Fedora or any new version of Linux,
Linux comes with Squid, choose that when you install , mostly squid is auto selected.
After you have configured your Linux box, go to :
#
# cd /etc/squid/
# more squid.conf
squid usually configures itself on port 3128
before anything is process under squid it look at two files.
restricted-sites.squid and allowed-sites.squid,
these are the two files where whatever you put as .domain.com is allowed under allowed-sites.squid and restricted under restricted-sites.squid
after you are done adding the domains. for e.g
if you want to allow website www.google.com then
# vi allowed-sites.squid
.google.com
save the file and you are good.
after you are done adding the website use:
# squid start or look at the above command on this page.

I used Microsoft Active Directory to automatically deploy proxy server on IE or do it manually on IE and limit access control to change IE settings.

cheers

dheeraj said, on April 7, 2008 4:27 AM:

Hello sir,
I am dheeraj from chandigarh i am working in a big organisation. Here i want to config squid server in linux 4.0 but i no about this server so please tell me how to configue this server anh how to allow sites and restricted sites. Please tell me

jiten said, on April 29, 2008 1:18 PM:

dear sir,one problem in create squid server,when i done total configuration & start the service of squid but output display failed,i dont know wt is editing in vi /etc/squid/squid.conf & also editing in vi /etc/init.d/squid.also don`t know about activated lines in squid.conf.

Frank said, on May 1, 2008 8:35 AM:

I am running squid as a proxy on a server outside the firewall to serve up web pages. The proxy and web server are running windows and the service on the web server is Apache. The problem is no matter what I do I can not get squid to serve up a web page. Im not getting any errors in the logs. I do get the error page from squid then I type the URL into the browser ( Im running squid in transparency mode so the user need no browser configuration )Any ideas?

space said, on May 13, 2008 1:50 PM:

hi... i m working with company as network administrator . now i like setup my network with linux server with internet. but i don't have any idea about squid and all .. u guys please help me about please.

navazkhan said, on June 9, 2008 4:52 AM:

Hi All,

I have 150 computers in my network and i wnat to allow only 10 people to use internet.
So iam using squid , please tell me what i need to edit in Squid.conf file to allow 10 members to use internet.

Thanks

sunny said, on July 10, 2008 1:26 AM:

hi all this is sunny i m working as a network admin i hav 25 computer which is running internet for security perpus i want squid server as a proxy i hav redhat 5.0 ant 2 network card can u help me how i can configure that


thanks

shajakhan said, on August 5, 2008 4:46 AM:

Hai everybody
I configured squid proxy server in my lan clients to access internet. Also i allowed limited websites in that(vi /etc/sites.allow). I have problem now which is some of sublinks not opened what to do help me

KARUN JHA said, on August 21, 2008 4:19 AM:

Dear Sir,

I am fresher in Linux line but I want to confi squid server. Plz send me squid.conf file with full details.

I am waiting a positive reply from your end

shahnawaz said, on September 17, 2008 5:05 AM:

hi all this is sunny i m working as a network admin i hav 25 computer which is running internet for security perpus i want squid server as a proxy i hav redhat 5.0 ant 2 network card can u help me how i can configure that

Noman said, on October 27, 2008 9:17 AM:

Hello My Name Is Noman, I am running an Internet Cable in which I have about 100 workstations and one server. Now I am planning to configure a proxy server on LINUX for my Cable Network to improve performance in browsing. For this I have installed Complete fedora 6.1 in a machine equiped with 512G RAM, 40GB HDD, 2.6GHz Processor, Intel P4, plus 2 NICs (Real Tech). But I have no idea about how to configure PROXY on it. Kindly let me know about any links or tutorial which can help me in a jumpstart. I do not want to mess with linux deeper. I just want to configure PROXY and that is it.

Mr. kamal kumar said, on November 20, 2008 10:06 PM:

Dear Sir.
I ma Mr. Kamal kumar
this problem is Linex Server per web. sait Blockes ke liya muje cuche solesan tale me

thankings to you

shayan Iqbal said, on November 24, 2008 6:01 AM:

i need information on SQUID server that how it works so kindly help me...

nazareno said, on November 26, 2008 8:35 PM:

hi hlo sir please can you help me how to black the bad site.or how to attatch the linux on that pc.

mano said, on November 28, 2008 4:38 AM:

dear sir

hai sir i am doing system admin a college so i need squid configure linux please help me

thanking sir

shidhin said, on November 29, 2008 11:54 PM:

Sir, how to configure a proxy server in Red hat 5.0 ?

vijay said, on December 5, 2008 3:02 AM:

i have purchased 2 sunfire x4200 and x2200 amd processor server
we are going for freelinux or red hat linux with squid proxy


pls guide for full installation and availability for linux drivers

so that installation will be carried successful


we are

vijay said, on December 24, 2008 5:47 AM:

i want to install fedora 9 server or red hat linux 9 serveron sunfire x2200 and x4200 amd server
how should i get driver easily from internet,how should i install linux os with firewall,proxy,email,antivirus free

Md.sahin Mia said, on January 15, 2009 10:56 PM:

I am running an Internet Café in which I have about 45 workstations and one server. Now I am planning to configure a proxy server on LINUX for my cafe to improve performance in browsing. For this I have installed Complete REDHAT 9.0 in a machine equiped with 1 G RAM, 80GB HDD, 3 GHz MP, Intel P4, plus 2 NICs (Real Tech). But I have no idea about how to configure PROXY on it. Kindly let me know about any links or tutorial which can help me in a jumpstart. I do not want to mess with linux deeper. I just want to sonfigure PROXY and that is it.

ashish said, on February 7, 2009 9:13 PM:

sir i work in networking my linux proxy serwer is not to riplay & claint to not riplay to proxy serwer but proxy sewer net is all time comining

amit said, on March 15, 2009 5:33 AM:

Hello sir,
I am amit from chandigarh i am working in a big organisation. Here i want to config squid server in linux 4.0 but i no about this server so please tell me how to configue this server setp by step how to allow sites and restricted sites. Please tell me

amit said, on March 15, 2009 5:36 AM:

hi all this is amit i m working as a network admin i hav 25 computer which is running internet for security perpus i want squid server as a proxy i hav redhat 5.0 ant 2 network card can u help me how i can configure that

HMT Rajesh said, on March 25, 2009 5:54 AM:

what is the procedure to intall proxy server.
internet comming im my linux server. i requied to access internet thorough my server.two nic required or not. what is config and ip address sceme access through my server.

soe paing said, on May 19, 2009 9:00 PM:

Hello My Dear Sir,
I am using openSUSE linux 11.0 and i want to run proxy server in there.How do i need to run for that.
Please let me share idea from your.I am a begineer for linux.So pls share me step by step running proxy server.
Thank you very much.

Raymon said, on May 29, 2009 8:14 AM:

i didn't entered my proxy server. my server is linux
i am according to logging but forget linux command.
Actually i want to know command for go to white list.
Please advised me.


Thanks
Raymon

Pon Sundar said, on September 22, 2009 1:34 AM:

Hello sir,
I am sundar from chennai i am working in a big organisation. Here i want to config squid server in linux 5.0 but i no about this server so please tell me how to configue this server setp by step how to allow sites and restricted sites. What is requirement in my system... Please tell me.

sanjibchakraborty said, on December 15, 2009 5:44 AM:

please send me squid server configuration on redhat linux5 or links in details

ankit said, on January 5, 2010 5:43 AM:

repected sir,
i wanna configure squid as proxy server for my network but I don't now how to configure in linux please give me idea

Thanks

Shan said, on January 25, 2010 3:01 AM:

sir
i am working system engineer in priveate college. i have how to config squid . pls help me sir. i am using redhat EL4. ple help config squid command thaning u sir

shivappa said, on February 8, 2010 5:38 AM:

how to set time in squid server(Redhat enterprise server4.0)

shekhar said, on February 12, 2010 9:18 AM:

hi
my name is shekhar i am a network admin, so i need to configure proxy for particular 10 ip's in 100 systems so please can u give the details abt squid server how to configure the squid server and how can i assign internet for particular 10 to 15 system trough linux proxy server

siva said, on March 1, 2010 11:16 PM:

i am fresher for linux server,i have 25 users from linux i want to block some websites like monstar,sexy sites please hlp me

Geo said, on April 28, 2010 3:18 PM:

Hello

I have a little problem with my proxy server. I've allready configured squid and it's working when my clients connect only using the dhcp server.
Now i want to connect my clients using pppoe. Unfortunatly when the client connects by pppoe they're connection doesn't pass through squid. How can i fix that.
Thanks

John said, on May 12, 2010 1:13 PM:

Hi there. How your doing Mr. Dave? I got a quick question for ya? I'm new to the linux world. I need information in installing proxy server, firewall, mailgate, DHCP on linux server.

suresh said, on May 14, 2010 4:28 AM:

sir
i am working as technician in some institute. we have 400 computers on net and one server. on we have install linux verson 9.0. and other pcs are installed windows xp service pack 2 . i wants to block some chating sites and adults sites. please help me how we can block the sites using the proxy server

chandru said, on May 14, 2010 4:31 AM:

Hello sir,
I am chandru from coimbatore i am working in a engineeering college. Here i want to config squid server in linux 5.0 but i no about this server so please tell me how to configue this server setp by step how to allow sites and restricted sites. What is requirement in my system... Please tell me.

ward shepherd said, on August 12, 2010 3:05 PM:

Please help advise me on a project. We want to set up a proxy on 1 of our free wifi access points to serve ads from publisher can any one help me? our radios have 8mb memory. I will even pay or contract this out if it can be done quickly?? please email me with suggestions or prices to get this done. numberonerhino@aol.com Thank You!

Rahul said, on August 30, 2010 2:32 AM:

sir
i am working as technician in some institute. we have 400 computers on net and one server. on we have install linux verson 5.0. and other pcs are installed windows xp service pack 2 . i wants to block some chating sites and adults sites. please help me how we can block the sites using the proxy server.
Please Support me.

Amarjeet Singh said, on September 1, 2010 4:03 AM:

Hello,
I'm working in belwo as Linux Admin,
i want to controll the bandwidth on ipcop,it is linux based.
plz help me

Thankyou

Rigan said, on September 30, 2010 2:07 AM:

Thanks

muthukumar said, on November 28, 2010 10:09 PM:

sir,


I am working system admin my user all browsing enable and download working. i will stoped in all user end to browsing how to config proxy server in step by step windows or linux.

Please support me

yasin said, on January 20, 2011 5:07 AM:

sir
i am working as technician in institute. we have 25 computers on net and one server. on we have install linux verson 5.4. and other pcs are installed windows xp service pack 2 . i wants to block some chating sites and adults sites. please help me.
how we can block the sites using the proxy server.
Please Support me.

manas said, on February 14, 2011 3:17 AM:

bros.........
jst follow it....

on ur terminal, jst install squid from yum...
then in /etc/squid/squid.conf
do a correction.....
change http_port to 8080
in http settings around637th line add
http_access allow good
around 589th line add
acl good src 192.168.1.0/255.255.255.0.0

it'll help u....

prasannapsp said, on March 7, 2011 6:02 AM:

Hi,
my Lan ip is 192.168.1.0/24 squid is working fine on url filtering ,today I have created webserver with dmz port ,I am able to access that server from outside world but not from LAN .

Any comments ?

suraj said, on June 3, 2011 12:35 AM:

hey im not getting http://www.facebook.com website as it is bloacked by server…. how to solve it?
what is the method to unbloack it?

puc48 said, on August 14, 2011 11:50 AM:

Amazing post mate!
I'm currently fighting with myself to set a squid server up... For now I use web proxies from a proxylist like http://AnonTux.com . The method is quite good, but I will take a look at squid too!

Thanks again, hope you won't stop to write such good posts (-;

puc48

asifiqbal said, on October 23, 2011 9:28 AM:

no wy frind

suman santra said, on November 11, 2011 12:58 AM:

sir,
how can i configure(squid,smtp,httpd,ftp,sumbausre
permision,etc)

thnx u

Andrew Valentine said, on May 15, 2012 7:52 AM:

Pls. can any one give procedure on how to configure squid on win2008

Hari said, on June 26, 2012 12:12 AM:

Hi sir,

I am working on squid proxy, when i try to ppcreport.php in my browser it shows "connection was reset" and for someother sites its shows "error 324" empty response.
i changed max_execution_time but still the same error.
can you help me.

Thanks
with regards,
Hari

Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

I do have a comment, now that you mention it!











I will never send you any unsolicited email. Ever.






Check This Out Too...

 
Look for Answers
Need Help? Ask Dave Taylor!
Powered By
Linux Journal: Free Issue!


Follow Me on Pinterest

Find Me on Google+
ADT on G+
© 2002 - 2013 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. My lawyer says "Thanks".
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.