Posts Tagged ‘Squid’

Running squid as user on Debian

August 20, 2007 Leave a comment

Install the required packages:

$ sudo apt-get install squid3 apache2-utils fakeroot

Create then $HOME/.squid3/squid.conf file:

cache_dir ufs @HOME@/.squid3/cache 100 16 256
auth_param basic program /usr/lib/squid3/ncsa_auth @HOME@/.squid3/passwd
auth_param basic children 1
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
cache_log @HOME@/.squid3/cache.log
access_log @HOME@/.squid3/access.log
cache_store_log @HOME@/.squid3/store.log
cache_swap_log @HOME@/.squid3/swap.log
pid_filename @HOME@/.squid3/pid

Replace @HOME@ by your home directory, don’t use $HOME. Add what you want from /etc/squid/squid.conf or

Create a password file:

$ htpasswd -c $HOME/.squid3/passwd $USER

The first time you run squid you must create cache directories:

$ fakeroot /usr/sbin/squid3 -f $HOME/.squid3/squid.conf -z

To run it normally just do:

$ fakeroot /usr/sbin/squid3 -f $HOME/.squid3/squid.conf -NX -d 99

Tags: , ,