Installing Squid proxy server in Ubuntu

Squid is a proxy http server that speeds up getting pages from the internet by keeping copies of commonly accessed pages or graphics instead of downloading them each time. To install it:-

1. From a root terminal type apt-get install squid

2. Open gedit /etc/squid/squid.conf

3. Find the TAG: visible_hostname and after the comments section add visible_hostname <hostname> where <hostname> is your machine’s hostname.

4. Check http_port is either set to 3128 or a port number that you can remember for configuring your browser.

5. Close and save

6. Type adduser squid and specify a password

7. Restart squid by typing: /etc/init.d/squid restart

8. Stop the service by typing /etc/init.d/squid stop

9. Test it in debug mode by typing squid -z (which creates the cache files)

10. Type squid -NCd10 to test squid in debug mode and leave it running.

11. Open Firefox and type the URL localhost:3128 or whatever port you chose. It will fail to retrieve a page, but at the bottom it will confirm that the error is generated by squid.

12. Back at the Terminal type CTRL-C to cancel the debug mode

13. Start squid for real with /etc/init.d/squid start. It will start automatically from now on.

14. To configure Firefox to use squid, go to Edit>Preferences and click Advanced.

15. Click Network>Settings and then Manual Proxy Configuration. For http proxy, enter localhost and for port 3128 (or whichever port you chose).

16. Then click OK and close the Preferences dialogue.

17. Now go to any webpage. If you get the page, it’s working!

Powered by ScribeFire.

Advertisements

26 thoughts on “Installing Squid proxy server in Ubuntu

  1. I wish to thank you on this article on how to configure squid.I find it very very good, simple and very important.I’m new to linux but have read lots of articles on ubuntu and i like it.I want to be good at installing and configuring of squid,ssh, apache etc.I mean i want to know how to install and configure a proxy server and also a dns server.Please i will be ever grateful to you once again if you will help me with informations like this very invaluable one.
    Thank you so much and i am ever grateful to you.
    I owe you.
    God bless you.
    Mohammed Awal Swedor.

  2. You say to try ‘localhost:3128’ but this should be :3128. It took me a few minutes to figure out why everything was borked for me.

  3. I managed to get squid installed but now I get this error message when I go back to the home page or previous page.

    Cache Error!
    The following error has occured: tinyproxy was unable to connect to the remote web server. Generated by tinyproxy (1.6.2)

  4. Hi. I had problems installing squid it 8.04 but if you get an error heres the command…

    sudo aptitude install squid squid-common
    then edit the squid config file.

  5. You are amazing. This has been the easiest and BY FAR the best tutorial I have seen thus far for ubuntu/linux. I commend you on a job well done!

    Also, just a quick question- what does the squid proxy do exactly? It doesn’t hide my ip, so does it just encrypt the data I send?

  6. Same here! Thank you for the comprehensive step-by-step instructions, they worked.

    Now, what else can I mess with in this Linux box…

  7. Thank you for the comprehensive instructions: very easy to understand for a novice. And more importantly, my new pet Squid is quietly swimming through the Internet – now he’s hungry for information.

  8. parseConfigFile : squid.conf:3384 unrecognized : ‘ to’

    i had followed the instruction step by step but when i type ‘squid -z’ in terminal it shows this line and i have no idea what it is,
    can you help me plz?

  9. hi,
    i have followed the instruction and every thing was ok but I could not get the page, my socks proxy server is password required, and in this instruction I don’t know where to set it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s