A proxy server is a server that acts as an intermediary between the client computer and the destination server.
Some of the advantages of connecting to the Internet using a proxy server are:
- To hide the IP address of a client computer
- To speed up Internet connection, because the proxy server uses caching techniques.
- To save bandwidth and prevent downloading the same file over and over again.
- To audit Internet usage (useful for companies wishing to monitor employee performance)
- To perform a scan of files accessed from malware / virus attacks
- To scan outgoing traffic (avoid data theft)
- To block sites
- To access sites blocked by ISP / Office / School, etc.
- To bypass parental control
- and many more benefits of using a proxy server.
Why make a private proxy server if we can use a free / open proxy server? The use of free or open proxy servers can be dangerous for you. Try to imagine if the open proxy server you are using logs all your browsing activities? The owner of the open proxy server can easily find out what sites you visit, what files you download, even the extreme is that the proxy server owner can also know the username & password of the site you are logged in.
Why would you risk your privacy and important data if we can make a proxy server with only $1 per month? Yup, maybe you think I'm tricking you, but in fact you can create a private proxy server through a VPS rental with prices starting at $1 per month. Please visit the article "How to Get a VPS At Low Prices" for details.
Installing a private proxy server using Squid only takes 5 minutes, and you don't need to be a Linux expert, even beginners can. For hardware, a 128 MB VPS using 32-bit Debian OS can be used. You can use both OpenVZ, Xen or KVM based VPS. If you have more budget, you should choose a VPS with large RAM and an SSD hard drive.
Before starting the installation, I assume you already have a VPS with Debian OS (fresh installation, 32 bit / 64 bit).
- The first step, we will first update the package list and then upgrade the package. Type the command:
apt-get update && apt-get upgrade
- Then we will install Squid, with the command:
apt-get install squid
- Because we will be using the NCSA module for the authentication system (login), then we have to install it apache2-utils so we can use commands htpasswd to create a username & password. type the command:
apt-get install apache2-utils
- Next we will create a username & password so that we can use this proxy server, enter the command:
htpasswd -c / etc / squid / passwd test123
NOTE: replace test123 with the username you want.
Then you will be asked to enter the desired password.
- So that Squid can read the passwd file you just created, type the command:
chmod o + r / etc / squid / passwd
- Next we will examine the location ncsa_auth with the command:
dpkg -L squid | grep ncsa_auth
The output of the above command will appear the location ncsa_auth which usually is / usr / lib / squid / ncsa_auth
- Next we will configure the squid.conf file according to our needs. First backup the default squid.conf with the command:
mv /etc/squid/squid.conf /etc/squid/squid.conf.old
- We create a new squid.conf file with the following command:
and enter the following configuration:
- Restart Squid with the command:
- Done! Your private proxy server is ready to use.
- To check if Squid is running on our server, type:
netstat -pln | grep squid
And if the output looks like this, it means that Squid is running well.
tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN 2594 / (squid) udp 0 0 0.0.0.0:3130 0.0.0.0:* 2594 / (squid) udp 0 0 0.0.0.0:44716 0.0.0.0:* 2594 / (squid)