Posted by: pufferfish on: April 15, 2007
Squid Installation How-To in Slackware
Document is written to give straightforward steps to install squid web caching server.
Platform: Linux Slackware
Squid version: Squid-2.6-Stable-12
Steps:
a)Download Squid Source and Patches
Get squid latest source from http://www.squid-cache.org/Versions/v2/2.6/
# cd /home/
# wget http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE12.tar.gz
# tar -xvzf squid-2.6.STABLE12.tar.gz
# cd squid-2.6.STABLE12
Apply the patches as,
# patch -p1 ..
b) Building Squid
Configure squid cache server and build based on your requirement. For default configuration,
# ./configure –prefix=/squid/ –sysconfdir=/etc/ –enable-gnuregex –enable-async-io=16 –with-aufs-threads=16 –with-pthreads –with-aio –with-dl –enable-storeio=aufs –enable-removal-policies=heap –enable-delay-pools –disable-wccp –enable-cache-digests –enable-default-err-languages=English –enable-err-languages=English –enable-linux-netfilter –disable-ident-lookups –disable-hostname-checks –enable-underscores –enable-snmp –enable-useragent-log –disable-wccpv2 –enable-epoll –disable-internal-dns –enable-htcp
# make
# make install
Note: If you find problem during configuration, act based upon the input given. If you could not solve it, please send your queries or problem to squidrunner_dev@yahoo.com or pufferfish@lycos.com
c)Configuring Squid
With default configuration of squid installation, squid is installed in /squid/ directory. Before starting squid, we have to change configuration file and ownership.
i)Check squid user availability
# id squid
Has to return user information with group details.
If you find Cann’t find user squid then,
# groupadd squid
# useradd -g squid squid
ii)Editing squid configuration file (squid.conf) for Proxy Mode
Get your machine hostname or Fully Qualified Domain Name as,
# hostname
Open /etc/squid.conf with vi editor or view or vim as,
# vi /etc/squid.conf
Turn vi editor to Insert mode by pressing “i” character on keyboard
visible_hostname “your hostname”
cache_effective_user squid
cache_effetive_group squid
iii)Changing directory permission
Change /squid/var/ directory with permission to squid:squid as,
# chown -R squid:squid /squid/var
d) Creating swap directories and starting Squid
During first time startup of squid, you have to create swap directories as,
# /squid/sbin/squid -z
Note: If you find problem during swap directories creation, act based upon the input given. If you could not solve it, please send your queries or problem to pufferfish@lycos.com
Start squid in non-deamon and debug mode as,
# /squid/sbin/squid -NCd10
If you get “Ready to server Requests” message then our squid installation is successful.
Troubleshooting Note:
Sometimes you may find problem to start squid because of DNS server resolvation, then you can start it by disabling INTERNAL DNS lookup as,
# /squid/sbin/squid -NCd10 -D
e)Starting Squid in Daemon Mode
Start squid in daemon as,
# /squid/sbin/squid
f)Stopping / Reconfiguration / status check on squid
To stop squid,
# /squid/sbin/squid -k shutdown
To reconfigure squid configuration file of squid.conf,
# /squid/sbin/squid -k reconfigure
To check whether squid is running or not,
# /squid/sbin/squid -k check
g)Maintenance of squid
i)Log rotation of squid is needed. Squid will generate error logs, web access logs and disk access logs. Log rotation is needed to handle disk usage effectively. We can rotate them as,
# /squid/sbin/squid -k rotate
Note: It is good to archive older logs to save disk space.
ii)Put system start-up script for squid so that squid will be started on every reboot of machine.
in slackware put in /squid/sbin/squid -sYD in /etc/rc.d/rc.local
I had an error with this. I have slackware 11 with the 2.16 kernel. Note, I run as root (I am sure I’ll here comments about this).
I believe I followed the directions correctly but when I was at this step
/*
Open /usr/local/squid/etc/squid.conf with vi editor or view or vim as,
# vi /etc/squid.conf
*/
I did not have the directory /user/local/squid. I just edit the /etc/squid.conf file.
So, I kept on following the directions up until I tried to create the swap directory and I get this message:
#/squid/var# /squid/sbin/squid -z
FATAL: Bungled squid.conf line 4409: cache_dir ufs /squid//var/cache 100 16 256
Squid Cache (Version 2.6.STABLE12): Terminated abnormally.
yes, i would like to be friend with any of squid’s users!
Hmm. Every time I attempt to run this tutorial, I get a hanging error – squid makes it as far as starting, then hangs on the following:
storeLateRelease: released 0 objects
I never get as far as “ready to server” – it just stays on the init screen. Ideas?
Hello,sorry about my English, I installed as your guide on Slackware 12 and Squid 2.7 Stable, I follow the steps until the comments on to create the directory /squid /var/cache ; but I have the error:
FATAL: Bungle (null) line 175: cache_dir ufs /squid/var/cache 100 16 256
If I uncomment cache_dir in squid.conf then I get the error:
FATAL: Bungle squid.conf line 1939: cache_dir ufs /squid/var/cache 100 16 256
You can help me?
thanks.
this error:
FATAL: Bungle (null) line 175: cache_dir ufs /squid/var/cache 100 16 256
because:
–enable-storeio=aufs
then fix with:
cache_dir aufs /squid/var/cache 100 16 256
nice howto, thnks
April 16, 2007 at 11:36 pm
Nice blog!