How To build Squid Proxy

what is squid proxy ??

Squid Proxy is an open-source, high-performance caching proxy server that is widely used for improving web performance and controlling internet access.

Step Step to install squid proxy on Ubuntu server

sudo apt update
sudo apt upgrade -y
sudo apt install squid
sudo systemctl start squid
sudo systemctl enable squid

Step Step to Configure squid proxy on Ubuntu/Debian server

for configuring squid proxy like Port or or Domain Proxy you need to edit on ubuntu server, so make sure to use this code and edit the port and domain proxy.

sudo nano /etc/squid/squid.conf
    

now you need to setting port, find and uncheck to setting up port. for Example in port 3128. you need to setting up like bellow

http_port 3128
acl allowed_network src 192.168.1.0/24
http_access allow allowed_network
http_access deny all
    

Save and close the file by pressing Ctrl + X, then Y to confirm, and Enter

To apply change your configurations, you need to restart Squid and configure Firewalld:


sudo systemctl restart squid
sudo ufw allow 3128/tcp
    

Verify Squid Proxy Installation


curl -x http://your_squid_server_ip:3128 http://google.com.sg
    

Step Step to install squid proxy on CentOS/RHEL server

sudo yum update
sudo yum upgrade -y
sudo yum install squid
sudo systemctl start squid
sudo systemctl enable squid
sudo systemctl status squid
    

Step Step to Configure squid proxy on CentOS/RHEL server

for configuring squid proxy like Port or or Domain Proxy you need to edit on ubuntu server, so make sure to use this code and edit the port and domain proxy.

sudo nano /etc/squid/squid.conf
    

now you need to setting port, find and uncheck to setting up port. for Example in port 3128. you need to setting up like bellow

http_port 3128
acl allowed_network src 192.168.1.0/24
http_access allow allowed_network
http_access deny all
    

Save and close the file by pressing Ctrl + X, then Y to confirm, and Enter

To apply change your configurations, you need to restart Squid and configure Firewalld:


sudo systemctl restart squid
sudo firewall-cmd --zone=public --add-port=3128/tcp --permanent
sudo firewall-cmd --reload
    

Verify Squid Proxy Installation


curl -x http://your_squid_server_ip:3128 http://google.com.sg
    

If configuration and installation you follow on here maybe you have done setting up the proxy. If have an error please fix error and try again the installation basic.

Leave a Reply

Your email address will not be published. Required fields are marked *