Friday, March 4, 2011

Task: Install proxy server

As already mentioned on the blog the plan for installing the proxy server is using Squid. Because of the fact that Squid actually does not have it's own GUI at first I decided to use the GADMIN-Squid tool for configuring the proxy server in a graphical interface.
(The packages can be downloaded and installed via the Synaptic Package Manager found under the "System"->"Administration" menu in your Ubuntu OS.)

After the installations are completed you can check if the proxy server is on (or start, stop, restart it) with the following commands:

$ sudo service squid status
$ sudo service squid start
$ sudo service squid stop

$ sudo service squid restart

When it's on you will get a note that it's running and the process ID number.

To give the wanted network(s) access to the server the right permissions need to be set. Edit the Squid configuration file.
(Before you do that you better make a backup copy of the file in case something goes wrong:

$ sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.original #Copy file
$ sudo chmod a-w /etc/squid/squid.conf.original #Protect from writing

Now you have the original file as squid.conf.original and you can safely edit the squid.conf file.)


Theoreticaly it can be edited in the GUI of the Gadmin software (image on the right), but I couldn`t manage to do so and at the same time keep the server running. A nasty thing happens, the server stops running after a few seconds every time I start it. The only thing that struck into my mind is that Gadmin maybe adds some default settings that are messing with mine, despite the fact that I say 'no' when it asks me if I want to install its default settings... I also looked for some kind of a 'time-to-live' option, but that seemed illogical and I couldn't find anything.

After spending 4 hours yesterday and 3 hours today (Damn.) trying to figure out if it was I who did something wrong I decided to simply add the permissions manually. Open the configuration file:

$ sudo gedit /etc/squid/squid.conf

This is still a testing stage, so the permissions I added are:
- allowed http access for 'internal_network' with IP range of the virtual machines I have in VBox
- allowed http access for 'external_network' with IP range of the IPs my router gives
- denied http access for 'restricted' with IP in the 'external_network' range

How to add permissions see in the bunch of tutorials in the reference section below.

-> https://help.ubuntu.com/6.06/ubuntu/serverguide/C/
squid.html


-> http://www.basicconfig.com/linuxnetwork/setup_ubuntu_
squid_proxy_server_beginner_guide


-> http://www.ehow.com/how_5019947_set-up-proxy-server-ubuntu.html

No comments:

Post a Comment