How to install and set squid proxy server

To install and configure set squid proxy server

In this article we will discuss how to install and configure squid proxy server on Ubuntu or Debian. Squid is an open source featured web proxy cache server. It was released under GPL 3. It mainly supports HTTP and FTP protocols.

To install and configure Squid Server

Execute the following command in the terminal

[root@linuxhelp:~]# apt-get install squid
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  fonts-opensymbol libabw-0.1-1v5 libboost-date-time1.58.0 libcdr-0.1-1v5
.
.
.
0 upgraded, 5 newly installed, 0 to remove and 165 not upgraded.
Need to get 2,137 kB of archives.
After this operation, 9,267 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
.
.
.
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...


Default configuration file for squid is located under ‘ /etc/squid3/squid.conf‘ or ‘ /etc/squid/squid.conf‘ .

Using VI editor

[root@linuxhelp:~]# vi /etc/squid3/squid.conf

http_port : This is the default port for the HTTP proxy server

http_access deny all - deny all access to the HTTP proxy server

visible_hostname - to set the specific hostname to a squid server


To restart the Squid proxy server

[root@linuxhelp:~]# service squid3 restart

OR

[root@linuxhelp:~]# service squid restart

To test the proxy server

Open Firefox and go to Edit &ndash > Preferences &ndash > Advanced &ndash > Network &ndash > Settings and select “ Manual proxy configuration” and enter the proxy server ip and port number in the required field.

After the required proxy details are entered you can browse using the Squid proxy server.

The default log file for Squid server is in ‘ /var/log/squid3/access.log’ or ‘ /var/log/squid/access.log‘

To change the default storage path of log file

Change the path by editing the ‘ squid.conf‘ file.

access_log daemon:/var/log/squid3/access.log squid

Tag : Proxy server
FAQ
Q
What is the Default port number for squid proxy server?
A
the default port number for squid procy server is 3128.
Q
How to find the access log for particular IP?
A
You can make us eof the following command
tailf /var/log/squid/access.log | grep 192.168.5.30
Q
How to manually configure proxy settings in firefox browser?
A
Use the following options
Edit –> Preferences –> Advanced –> Network –> Settings to manually configure Proxy in firefox
Q
What are all the protocols does squid support ?
A
The Squid supports the following protocols
HTTP
FTP
Q
How can i specify a hostname ?
A
You can specify Under "visible_hostname" in squid.conf file