How to Change the Default Listening Port for a Squid Proxy
II. How to Change the Default Listening Port for a Squid Proxy
III. How to Configure a Squid Proxy to Listen on Multiple Ports
Squid is a caching and forwarding web proxy. It is most often used in conjunction with a traditional LAMP stack (Linux, Apache, MySQL, PHP), and can be used to filter traffic on HTTP, FTP, and HTTPS, and increase the speed (thus lower the response time) for a web server via caching.
- These instructions are intended specifically for changing the default listening port for a Squid Proxy.
- In this case I’ll be working from a Liquid Web Core Managed CentOS 7 server, and I’ll be logged in as root.
By default, Squid launches a session listening on port 3128.
Running the command:
netstat -plant
Should show something similar to:
tcp6 0 0 :::3128 :::* LISTEN 6261/(squid-1)
Where :::3128 is the port on which Squid is listening.
Configuration file locations may vary. The config file should be called squid.conf. To find the config file use the following command:
locate squid.conf
You should receive a result similar to:
For a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor
Now, let’s edit the file found in the previous step:
vim /etc/squid/squid.conf
Look for a section of the configuration file similar to:
http_port 3128
Changing the port number is as easy as changing the number 3128. For example: to use port 1337 simply edit the file to include:
Exit and save the file, and then restart Squid:
systemctl restart squid
Now running the command:
netstat -plant
Should show something similar to:
tcp6 0 0 :::1337 :::* LISTEN 6261/(squid-1)
Where :::1337 is the port on which Squid is listening.
Related Articles:

About the Author: J. Mays
As a previous contributor, JMays shares his insight with our Knowledge Base center. In our Knowledge Base, you'll be able to find how-to articles on Ubuntu, CentOS, Fedora and much more!
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
How to Install Adminer MySQL Database Management Tool on AlmaLinux
Read ArticleWhat is CGI-Bin and What Does it Do?
Read ArticleTop 10 Password Security Standards
Read ArticleTop 10 Password Security Standards
Read ArticleHow to Use the WP Toolkit to Secure and Update WordPress
Read Article