This time, I’m gonna write a tutorial for installing squid proxy in a Debian VPS ( BuyVM )
- Lets install squid in the Debian VPS :
1# apt-get install squid - Shutdown squid if it’s running :
123# squid -k shutdownor# service squid stop - Configure the squid.conf located at /etc/squid/squid.conf:
1# nano /etc/squid/squid.conf
Add the following code at the top of squid.conf :
12345678910auth_param basic program /usr/lib/squid/pam_authauth_param basic children 5auth_param basic realm Squid proxy-caching web serverauth_param basic credentialsttl 4 hoursacl password proxy_auth REQUIREDhttp_access allow passwordforwarded_for offauth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/users_passwdacl ncsa_users proxy_auth REQUIREDhttp_access allow ncsa_users
To change the squid port from default port 3128 to another port, reopen again the /etc/squid/squid.conf, change the http_port from 3128 to another port to secure your squid from unauthorized use, for example :
1http_port 12873
Save the modified squid.conf by pressing Ctrl + O, and press Enter
Exit from nano editor by pressing Ctrl + X - Create file users_password for squid security purpose :
1# nano /etc/squid/users_passwd
Type a character and delete it. And then save the file by pressing Ctrl + O
Exit from the nano editor by pressing Ctrl + X - Now, we will use the function htpasswd from the apache to securing access to our squid server :
1# htpasswd /etc/squid/users_passwd user-for-accessing-squid
for example :
1# htpasswd /etc/squid/users_passwd userssatu
Type the password for it. - Running the squid :
1# service squid start - Now you have a squid program running in your Debian VPS.
If you want to use it, you can use the example configuration at your browser proxy setting :
IP Address : 123.123.123.123 Port : 12873
The IP Address is your VPS IP Address, and the Port is using your squid http_port configuration