How to Install Squid Proxy Server on CentOS 7

This can run on any VPS from us running minimum specs.

Make sure to have your server up-to-date by running

yum -y update

Next, we need to install Squid Proxy by running the following command:

yum -y install squid

Once your Squid has been successfully installed you can go ahead and start the program immediately

systemctl start squid

Do not forget to enable the squid service in order to start automatically at boot.

systemctl enable squid

It is important to check on the Squid status just to make sure that everything is working fine.

systemctl status squid

You should get dialog with a saying its running..

Configure Squid to Allow your IP

You will need to edit the configuration file and add your connecting ips or ranges.

vi /etc/squid/squid.conf

How to allow a range of IP addresses to access the Internet through your proxy server

It is just as simple as adding a new ACL entry, Squid supports CIDR notation which makes the job more simple, for example, if you want to allow a range of IPs from 192.168.241.1 to 192.168.241.255 then you will need to add the following entry:

Find the line that starts with # should be allowed and add your ip/range below that.

acl localnet src 192.168.241.0/24 # My new ACL

Or your work IP

acl localnet src 75.12.56.124 #Work IP

Last but not least restart squid to make the change active.

systemctl restart squid

Change Squid Default Port

If you feel the need of changing the Squid default port, you just need to modify:

vi /etc/squid/squid.conf

Then find the following line and change the port

Squid normally listens to port 3128

http_port 3128

Change to that to your favorite number

http_port 1337

Allowing access in firewalld

firewall-cmd --permanent --add-port=1337/tcp firewall-cmd --reload

Learn more about Squid at: http://www.squid-cache.org/.

  • 0 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

OpenVPN Tutorial For Debian/Ubuntu on OpenVZ

What is OpenVPN?OpenVPN is a reliable and well tested VPN solution that is able to run over a...

How do I SSH into my VPS? (OS X/Terminal)

If you are on a Mac, SSH-ing into your VPS is very simple. Simply launch "Terminal" by going to...

How do I SSH into my VPS? (Windows/Putty)

This article will teach you how to access your server via SSH using the PuTTY client on Windows....

Install Remi and EPEL yum repo Centos 7

Install Yum EPEL and Remi repositories on Centos 7 Adding additional useful repo's on Centos 6...

Install PHP/PHP-FPM 5.4 Centos 7

Install PHP/PHP-FPM 5.4 on Centos 7 PHP is a server-side scripting language designed for web...