How to change the listen port on the Squid proxy on Ubuntu

It is difficult to explain further what Squid Proxy is and how to use it, but there are some applications of Squid Proxy that can be used to filter HTTP or HTTPS destinations and speed up connections through its caching feature . The most important thing in Squid Proxy is also the port that will later be used to establish a connection. If you don’t set it, the user won’t be able to know which path Squid Proxy is running on.
It is the same as SSH that can set the listen port and for the original Squid proxy port it is 3128 and in fact it is very easy to change and only take a moment. Only here do I share a complete path from Configuration switching in detail so that users understand and can replace port 3128 with the port they want or add another port.
When the user has used the service SSH tunneling it’s free, of course they provide Squid Proxy for their own needs. Well, interestingly, the port provided is not just one, but several types, and that’s why I share this method for: Replace and add the listen port on Squid Proxy, but this time I only share specifically for the Ubuntu or Debian operating system. Here is the procedure, see below.
First, enter the terminal and enter the following code to find out if Squid Proxy is running.
netstat -plant
When it is run, this is how the system will appear.
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp6 0 0 :::3128 :::* LISTEN 6261/(squid-1)
Above it can be seen that the port Squid is currently using is 3128. Just go to configuration by entering this command.
vi /etc/squid/squid.conf
It will be directed to the configuration file and please scroll down and look for the section http_port. Change the port number to the desired port. For example, replace it as a port 8080so just change it that way.
http_port 8080
Press ESC then type : wq save on the keyboard. In the final phase, just enter this command to restart squid.
systemctl restart squid
Now try to type as in the first part, the port has certainly changed to 8080.
If you want to add another port just add it below it, for example the user wants to add port 2222. So the example looks like this.
http_port 8080http_port 2222
In Squid Proxy itself there is also a function to change the port directly with a command like this one Squid – a port but it is only temporary until the system reboots, then the port stops working. Before setting the method as above, make sure the user has it in the Network security groups and put incoming Port so that it can be used.
Hopefully useful and good luck