Installing Squid Proxy Server with User & Password
By Fahad Ahammed
- 3 minutes read - 434 wordsIf you work remotely, or have to handle corporate files on the road, then chances are you’ve used a specific type of proxy and may not even be aware of it. In fact, proxies are used by workers all over the world in the form of a VPN. A virtual private network is one specific type of proxy which provides you with the ability to work remotely and securely.So , here i will help you to install and configure squid proxy server in your vps or server .
Log in on Ubuntu Server, then type command below to Install squid :
Create directory for Cache, on this case cache directory placed on
directory /home/precise/cache/. Then change
the permissions cache directory to 777 and owner proxy:proxy
Before editing squid configuration, Make a backup of your
/etc/squid3/squid.conf file for future reference. Squid.conf has
nearly all the options listed and it is recommended to go through that
file to know more about squid options.
Now edit /etc/squid3/squid.conf file, delete all options
in /etc/squid3/squid.conf then replace with squid3 configuration below :
Squid3 configuration:
Create swap directory,
Restart squid3:
Your squid proxy server installation and configuration is complete . You have to set ip and port (which is by default 3128) in your firefox.
Note : Above we have used precise is red marked and that is the default user . You have to use yours username . There is also Blue marked texts on that configuration file . One is email which you should use your own or servers email and also name of the server owner.
Step # 1: Create a username/password
First create a NCSA password file using htpasswd command. htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of squid users.
htpasswd /etc/squid3/passwd user1
Output:
Make sure squid can read passwd file:
chmod o+r /etc/squid3/passwd
Step # 2: Locate nsca_auth authentication helper
Usually nsca_auth is located at /usr/lib/squid/ncsa_auth. You can find out location using rpm (Redhat,CentOS,Fedora) or dpkg (Debian and Ubuntu) command:
dpkg -L squid3 | grep ncsa_auth
Output:
If you are using RHEL/CentOS/Fedora Core or RPM based distro try:
rpm -ql squid | grep ncsa_auth
Output:
Step # 3: Configure nsca_auth for squid proxy authentication
Now open /etc/squid3/squid.conf file
nano /etc/squid3/squid.conf
Put this and save :
Squid3 configuration:
Create swap directory,
Restart squid3:
Your squid proxy server installation and configuration is complete . You have to set ip and port (which is by default 3128) in your firefox. After this when you will try to connect you will be notified to put username and password .