Amazon Links

Wednesday, February 16, 2011

Configuring Squid on Ubuntu 10.10

I recently upgraded my box to Ubuntu 10.10 and ran into problems with starting squid (Version 2.7.STABLE9-2ubuntu5).

I finally debugged and fixed the problem. The steps are as follows:-
  • Getting squid.conf right
The default user (and group) for running squid is 'squid'. This is not present in configuration.

I also ran into problems with configuration of squid.pid file.The default location is /var/run/squid.pid , where an non root user cannot create file. So i moved it to /var/run/squid directory.

The changes to /etc/squid/squid.conf are listed below.
cache_effective_user squid cache_effective_group squid pid_filename /var/run/squid/squid.pid
  • Fixing the file permissions and create directories
We need to set the file permissions for squid configuration, log folders to squid:squid and also create the directory /var/run/squid
The shell commands are:-
sudo chown squid:squid /etc/squid/squid.conf sudo mkdir /var/run/squid sudo chown -R squid:squid /var/run/squid sudo chown -R squid:squid /var/log/squid
  • Starting squid.
The squid on ubuntu 10.10 is triggered using service command. Start squid and check logs in /var/log/squid
sudo service squid start

You should see the squid running....

Squid: The Definitive GuideUbuntu 10.10 Essentials