Flux rss

[Ubuntu]Installing an HTTP proxy server (Squid)

Published by jak58, last update on Friday October 31, 2008 08:37:17 AM by jak58

Installing an HTTP proxy server (Squid)




1.Installing the proxy


To install Squid type the following command in a terminal:
sudo aptitude install squid

2.Configuring the proxy


Configuration of Squid is done through the editing of the following file: /etc/squid/squid.conf
To edit this file ,type Alt+F2 and enter the following command:

gksu gedit /etc/squid/squid.conf

2.1.Naming the proxy


Its important that Squid knows the name of the machine. To do this, locate the line visible_hostname.
For example, if the machine called ubuntu insert:

visible_hostname ubuntu

2.2 Choosing the Port


By default, the proxy server will use port 3128. To choose another port, locate the line:


http_port 3128


and change the port number, for example:

http_port 3177

2.3.Choosing the interface


By default the proxy server will listen on all interfaces. For security reasons, its better to put in on your local network only.
For example, if the network card connected to your LAN, has IP 10.0.0.1, change the line:

http_port 10.0.0.1:3177

2.4. Setting access rights and priorities


By default, nobody is allowed to connect to the proxy server. (Only from your machine itself)
A list of permissions must be created.

For example, we will define a group encompassing the local network.

Find the line beginning with acl localhost...
At the end of the section, add:

acl lanhome src 10.0.0.0/255.255.255.0


(lanhome is a random name chosen).


2.5. Authorizing access to group


Now that the group is defined, we will authorize to use the proxy.
Locate the line http_access allow ...
and add below (before the line http_access deny all):

http_access allow lanhome



2.6. Allow the use non-standard ports


By default, Squid allows HTTP traffic only on specific ports (80, etc.).
This can cause problems on websites using other ports.
Example: http://toto.com:81/images/titi.png will be blocked by Squid.

To avoid this deadlock, find the line:
http_access deny! Safe_ports

and the edit it to:
# http_access deny! Safe_ports

3.Starting the Proxy


Restart the proxy to take apply the modifications you made. Type:
sudo /etc/init.d/squid restart

From there, the proxy should work based upon your requirements. Just configure the software using the proxy and all should run smoothly.

Miscellaneous


Server logs


The proxy logs are located in: /var/log/squid/access.log
===Changing the size of the cache===

The Squid cache is enabled by default, which helps accelerate the loading of some pages.
The default allocated size is 100 MB(found in /var/spool/squid)

To change its size,edit the /etc/squid/squid.conf file.

Find the line:
# cache_dir ufs /var/spool/squid 100 16 256

Edit it. You can change the value 100 by what you want (eg 200 for 200 MB):
cache_dir ufs /var/spool/squid 200 16 256

Functions and additional modules


Squid is full of options and modules:

Prefetch (to preload the pages and speed up navigation).

Antivirus filters, AntiPopUp, etc..

Access control via proxy login and password.

Access control based upon hours.



To do this, open Synaptic, and click on Search and enter squid to find the modules related to Squid.
Consult the documentation for each module and the Squid manual for more information.

Links


See also:Installing an easy HTTP proxy-cache (polipo)
Network equipment - Proxy servers A proxy server is a machine which acts as an intermediary between the computers of a local area network (sometimes using protocols other than TCP/IP) and the Internet Most of the time the proxy server is used for the web, and when it is, it's an HTTP... en.kioskea.net/lan/proxy.php3
Encrypt a file through proxy server Hello, Using an online free proxy server, is there any of them that would encrypt the file i am downloading from another web site before it came to my pc? I.e. from website, to proxy server, gets encrypted, then to me Or even zip the file before... en.kioskea.net/forum/affich-15888-encrypt-a-file-through-proxy-server
Installing an easy HTTP proxy-cache (polipo) Installing an easy HTTP proxy-cache (polipo) Intro Quick Installation Allowing hosts on the LAN to connect Changing the port Use a proxy server parent Using an alternative DNS server Disabling IPv6 More info Intro Installing an... en.kioskea.net/faq/sujet-805-installing-an-easy-http-proxy-cache-polipo
Getting connected to Ingres: the nodeGetting connected to Ingres: the node Node structure Testing Installation password On server side On client side: Making use of the node. An important feature when using Ingres is the node (vnode). This is where the Ingres/Net... en.kioskea.net/faq/sujet-919-getting-connected-to-ingres-the-node
How to use a driver ODBC 32 BITS under the Window 2003(64 bits)?How to use a driver ODBC 32 BITS under the Window 2003(64 bits)? You have a Windows 2003 server (64-bits) and you want to use a 32 bits ODBC driver: one that is usually found in the administrative panel for ODBC on Windows or an external... en.kioskea.net/faq/sujet-707-how-to-use-a-driver-odbc-32-bits-under-the-window-2003-64-bits
MSN Connection ProblemsMSN Connection Problems Error Codes Error code 0x80072ee6 Error code 81000377 Error code 0x80072efd / 80072ee7 Error code 80048820 Error code 8007277b UNICOWS.DLL Error Code Other error codes Connection problems have become... en.kioskea.net/faq/sujet-156-msn-connection-problems
Windows 2003 serverHello, i formatted server and installed windows 2003 server. the server shared folder / system is not showing and is accessible the server shared folders from workstations. en.kioskea.net/forum/affich-15494-windows-2003-server
Firefox connection issuesHello, I have a problem with Firefox on my Mac. I had to change my network settings on my computer to use a proxy server to get onto the web at one hotel. Since I have done this (in the hotel everything worked fine) firefox cannot open any other pages... en.kioskea.net/forum/affich-24382-firefox-connection-issues
Serial number is requiredHello,i have a problem i wants to instal windows 2003 server in my system but i lost the serial number where i can find the serial number in the cd. en.kioskea.net/forum/affich-29103-serial-number-is-required
Download HFS (Http File Server)HFS is a ultra-simple way to share files with friends. · Launch HFS · Slide above it the file to be shared. And that’s all ! The directory is accessible from any browser. It is ultra-simple and no installation is necessary (HFS is only... en.kioskea.net/telecharger/telecharger-1703-hfs-http-file-server
Download AnalogX ProxyAnalogX Proxy is a waiter very light proxy (238 KB), who allows all machines of your network to have the access to Internet thanks to a machine exchange. It understands protocols HTTP (webs), HTTPS (secure Web), POP3 (accept from the mail), SMTP (Send... en.kioskea.net/telecharger/telecharger-163-analogx-proxy
Intranet - Installing a mail server The most commonly used e-mail server in Linux is Sendmail; however, as it is very hard to configure, we will use Qmail, an alternative e-mail server, instead. Qmail is made up of a group of programs that work with different UID/GIDs, in order to... en.kioskea.net/intranet/resmail.php3
Sharing an Internet connection with Jana Server If you have a local area network (two or more computers connected in a network, that is, each having a network card) with one computer connected to the Internet (via a modem, using a cable, etc.), it may be useful to make the Internet accessible to... en.kioskea.net/configuration-reseau/partage2.php3
Practical information - installing a VPN on XP Setting up a virtual private network allows you to connect remote computers in a secure fashion via an unreliable (Internet) connection, as if they were on the same LAN. This procedure is used by many companies in order to allow their users to... en.kioskea.net/pratique/vpn-xp.php3