How to Install and Сonfigure Squid Proxy in One Click
Proxies and VPNs are technologies that help protect one’s privacy and security online and that therefore have become necessary tools for almost every user. Some of the key advantages of using proxies and VPNs include improved security and the ability to bypass website blocks and restrictions. While some prefer buying ready-made solutions, others opt for crafting their own due to a wide variety of open-source products.
One of these is a proxy server called Squid. It’s a popular software solution for implementing a transparent proxy. In this blog post, we’ll answer the following questions: what is Squid proxy, how to use and how to config Squid proxy as well as how to check if your Squid proxy is working.
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. How does Squid proxy work? Squid sits between clients and external web servers, storing requested content locally to speed up response times and reduce bandwidth usage. When a client sends a request, Squid first checks its cache and returns the content immediately
Despite the wide functionality and a lot of settings, one of its core advantages is the ease of setup and installation. We have prepared a script that will allow even a novice to install and setup the Squid proxy on a VPS server and get started as quickly as possible.
For starters, we need a CentOS 7-based VPS server and the script below:
proxy_user=username squid_port=22412 yum install -y squid cat > /etc/squid/squid.conf << EOL auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/internet_users auth_param basic realm proxy acl authenticated proxy_auth REQUIRED http_access allow authenticated http_port $squid_port EOL PASSWORD=$(date +%s | sha256sum | base64 | head -c 32 ; echo -n) touch /etc/squid/internet_users htpasswd -b /etc/squid/internet_users $proxy_user $PASSWORD echo "$proxy_user $PASSWORD" > /root/proxyusers service squid restart cat << EOL http proxy: hostname ip: wget -qO- ipinfo.io/ip port: $squid_port user: $proxy_user password: $PASSWORD EOL
Before you start to install Squid proxy, you can edit the first two lines:
proxy_user = myuser <- enter any username
squid_port = 39128 <- enter any port
You don’t necessarily need to edit these parameters as the script will work even without your changes.
Copy the script above, paste it into the console and wait for the Squid proxy installation and configuration to complete. After completion, you will get a convenient output looking like this:
http proxy: myserver.01 ip: x.x.x.x port: 22412 user: username password: DSGSDJ#(@IEWJKF215
This data is from a fully-operational Squid web proxy. Now you can insert it into your browser and access the Internet through your own proxy server.