5 Minutes Install Squid Proxy Server

Must read:

Ferdian Alfianto

Ferdian Alfianto

Ferdian Alfianto is an Internet enthusiast, Mac Lover; likes using Wordpress, experimenting with Linux (especially Debian and Ubuntu), tinkering with pfSense routers, happy experimenting with LEMP (Linux, Nginx, MariaDB, PHP) and Redis. You can contact me here.

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.

Installation

Before starting the installation, I assume you already have a VPS with Debian OS (fresh installation, 32 bit / 64 bit).

  1. The first step, we will first update the package list and then upgrade the package. Type the command:
    apt-get update && apt-get upgrade
  2. Then we will install Squid, with the command:
    apt-get install squid
  3. 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
  4. 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.

  5. So that Squid can read the passwd file you just created, type the command:
    chmod o + r / etc / squid / passwd
  6. 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

  7. 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
  8. We create a new squid.conf file with the following command:
    nano /etc/squid/squid.conf

    and enter the following configuration:

  9. Restart Squid with the command:
    /etc/init.d/squid restart
  10. Done! Your private proxy server is ready to use.
  11. 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)
    
Facebook
Twitter
WhatsApp
Telegram
E-mail

Latest articles:

MongoDB logo
Linux

Easy to Install MongoDB on Ubuntu 20.04

This tutorial explains how to install and configure MongoDB Community Edition on Ubuntu 20.04. MongoDB is a free, open-source document database. Belongs to the so-called database family

Related article:

MongoDB logo

Easy to Install MongoDB on Ubuntu 20.04

This tutorial explains how to install and configure MongoDB Community Edition on Ubuntu 20.04. MongoDB is a free, open-source document database. Belongs to the so-called database family