The mandate
Install a proxy server on Debian

Install a proxy server on Debian

Category: Administration.
Posted by on the 25/07/2013.
Last update on the 25/07/2013.

   Next tutorial>>


This tutorial explains how to install and configure a proxy server in order to reduce the load when your users are connected to internet.


This tutorial is intended for people under Debian or distributions based on it (Ubuntu, Xandros ...). All commands in this tutorial are executed as root. (su command). It does not require any prerequisites. In this tutorial, we consider that the proxy server name is tutorielsenfolie, his IP address is and it listen to the port 3214.

Installation of the proxy server

To install the proxy server execute the following command:

apt-get install squid

Proxy configuration

Configuration of the server

We will now configure the server. But first of all, we will save the default configuration in the case of we have an issue with our new configuration. To do that, execute the following commands:

cd /etc/squid
cp squid.conf squid.conf.sav

Now, we can edit the configuration file:

nano squid.conf

Proxy name

In order to run correctly, squid need to know the name of the server. To do that, modify the line visible_hostname as follow:


visible_hostname tutorielsenfolie

Choose a port

By default, the proxy server listen the 3128. To modify this port update the line http_port like this:


http_port 3214

Choose the interface

By default, the proxy server listen all interfaces. For security reason, the proxy must listen only the local network. To do that, modify once again the line http_port:



Define the access right

By default, nobody can be connected to the proxy server, except the server itself. Therefore, we need to create an authorization list. We will, for example, allows the pc from the subnetwork to connect to our proxy. To do that, modify the configuration file (/etc/squid/squid.conf) as follow:


acl Safe_ports port 901 # SWAT
acl purge method PURGE
acl lanTutorielsenfolie src

Allow the group

Now that the group is defined we will allow it to use the proxy. To do that, modify the configuration file (/etc/squid/squid.conf) as follow:


# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet

http_access allow localhost
http_access allow lanTutorielsenfolie

# And finally deny all other access to this proxy
http_access deny all

Authorize non standard ports

If you want to authorize the http flow on non standard ports you need to comment the line http_access deny !Safe_ports (by adding # before the line) in the configuration file (/etc/squid/squid.conf).

Retart the proxy

Now that we have finished configuring the proxy server, we can restart it. To do that, execute the following command:

/etc/init.d/squid restart

You like this tutorial ?
Like this website in order to promote it on facebook !

   Next tutorial>>

You like this tutorial ? Share it with your friends !
Partager sur Facebook Partager sur Twitter Partager sur Myspace Partager sur Stumbleupon Soumettre sur Reddit Partager sur Digg Ajouter à vos favoris Technorati Ajouter à vos favoris Live Ajouter à vos favoris Google Ajouter sur vos favoris Yahoo