Installing Squid on CentOS 7.x and Ubuntu 16.04

Squid Proxy

Installing Squid Proxy on CentOS 7.x and Ubuntu 16.04

What is Squid Proxy

Squid is a caching and forwarding HTTP web proxy. It has a wide variety of uses, including speeding up a web server by caching repeated requests, caching web, DNS and other computer network lookups for a group of people sharing network resources, and aiding security by filtering traffic. (Read more on Wikipedia)

Making Life Easier

Again trying to make life a little bit more easier I have borrowed and modified a script that automates the installation and configuration of squid proxy on each system individually as follows;

Squid Proxy on Centos 7.x

Download the bash script from Github and edit the squid_user and squid_password fields with a custom user and a complex password. Then run the following command in bash prompt to start the one liner install.

[user@localhost ~]$ sudo -i
[root@localhost ~]# curl -O https://raw.githubusercontent.com/khaledalhashem/squid/master/squid_centos.sh
[root@localhost ~]# vi squid_centos.sh
..
squid_user=customuser
squid_password=complexpassword
..
[root@localhost ~]# chmod 0700 squid_centos.sh && bash -x squid_centos.sh 2>&1 | tee squid.log

Squid Proxy on Ubuntu 16.04

Download the bash script from Github and edit the squid_user and squid_password fields with a custom user and a complex password. Then run the following command in bash prompt to start the one liner install.

[user@localhost ~]$ sudo -i
[root@localhost ~]# curl -O https://raw.githubusercontent.com/khaledalhashem/squid/master/squid_ubuntu.sh
[root@localhost ~]# vi squid_ubuntu.sh
..
squid_user=customuser
squid_password=complexpassword
..
[root@localhost ~]# chmod 0700 squid_ubuntu.sh && bash -x squid_ubuntu.sh 2>&1 | tee squid.log

Thats all folks

Turn on your proxy and insert your proxy server address in your browser;

Firefox

Menu -> Preferences -> Scroll all the way down to Network Proxy and click Settings -> Check Manual Proxy Configuration -> Check HTTP Proxy and enter your server IP address with Port 3128.

Once you start browsing you will be asked for a username and password, use the ones you insert earlier in the script.

Chrome

Similar settings as above.

Enjoy browsing behind a proxy. 🙂