Industry guru Dave Taylor answers free tech support questions about a wide variety of business and technical topics, including blogging, Google AdSense, MySpace, Sony PSP, Apple iPod, Mp3 players, management, Linux, SEO, Mac OS X, Facebook, Twitter, LinkedIn and Microsoft Windows.

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.



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

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.

Posted by: Stewart Vardaman at March 4, 2005 6:21 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

Posted by: Pa Sara Drammeh at August 2, 2005 11:44 AM

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

Posted by: anonymous at September 16, 2005 1:43 PM

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.

Posted by: nitin at March 16, 2006 6:00 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?

Posted by: bob at April 28, 2006 9:48 AM

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?

Posted by: Dave Taylor at April 29, 2006 2:22 PM

nothing

Posted by: ramesh at January 11, 2007 5:55 AM

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!

Posted by: Rizky at February 8, 2007 1:12 PM

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

Posted by: sanjeev at February 28, 2007 11:20 PM

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

Posted by: Mir Hassni at March 25, 2007 7:08 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.

Posted by: amardeep at April 9, 2007 2:49 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

Posted by: dogra at April 16, 2007 1:38 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.

Posted by: Imran at April 28, 2007 9:53 AM

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

Posted by: dudemjk at May 24, 2007 7:32 AM

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

Posted by: pradeep yadav at July 8, 2007 10:38 PM

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.

Posted by: tanveer at July 24, 2007 12:03 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.

Posted by: amit at August 8, 2007 5:11 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

Posted by: Nandhakumar at January 25, 2008 5:45 AM

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

Posted by: Prashant Tomar at February 13, 2008 3:37 PM

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

Posted by: dheeraj at April 7, 2008 4:27 AM

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.

Posted by: jiten at April 29, 2008 1:18 PM

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?

Posted by: Frank at May 1, 2008 8:35 AM

I have a lot to say, but ...
Starbucks coffee cup I have a lot to say, and questions of my own for that matter, but most of all I'd like to say thank you for all your efforts on this Web site by buying you a chai!

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









Remember personal info?


Please note that I will never send you any unsolicited commercial email. Ever.

While I'm at it, 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.









Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.


Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Join the List!
Join my author info mailing list, where you'll learn about my upcoming books, speaking gigs, and more!


Book Links
© 2002 - 2008 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.

[whiteboard marker tray]