How to setup SQUID (proxy server) on Ubuntu

Sometimes you need to proxy your traffic over a server in order to pass certain firewall rules, and/or geographic restrictions on some websites, configuring SQUID on your own droplet it’s very useful to solve this kind of needs, and the installation it’s pretty straight forward

sudo apt-get install  squid apache2-utils

Now get rid of the /etc/squid3/squid.conf (backing it up if you want) and paste the following

auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwords
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated

# Please change this port number, this is a default, but for security reasons use another
http_port 3128

With this configuration you now have a SQUID proxy that just allow connections if the user it’s authenticated although there is still no allowed users, let’s get to it now.

sudo htpasswd -c /etc/squid3/passwords the_allowed_username

This command will ask for a password, type the one you want and then just restart SQUID service

sudo service squid3 restart



Leave a Reply

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

You are commenting using your 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