Squid Installation How-To
Objective:
Document is written to give straightforward steps to install squid web caching server.
Platform: Linux
Squid version: Squid-2.5-Stable-10
Steps:
a) Download Squid Source and Patches
Get squid latest source from http://www.squid-cache.org/Versions/v2/2.5/ and patches from http://www.squid-cache.org/Versions/v2/2.5/bugs/ site.
# cd /usr/local/
# wget http://www.squid-cache.org/Versions/v2/2.5/squid-2.5.STABLE10.tar.bz2
# tar -xvjf squid-2.5.STABLE10-tar.bz2
# cd squid-2.5.STABLE10
Apply the patches as,
# patch -p1 ..<(patch-name) [ where, patch is available in upper directory ]
b) Building Squid
Configure squid cache server and build based on your requirement. For default configuration,
# ./configure
# 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 [email protected] or [email protected]
c) Configuring Squid
With default configuration of squid installation, squid is installed in /usr/local/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
# useruser -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 /usr/local/squid/etc/squid.conf with vi editor or view or vim as,
# vi /usr/local/squid/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 /usr/local/squid/var/ directory with permission to squid:squid as,
# chown -R squid:squid /usr/local/squid/var
d) Creating swap directories and starting Squid
During first time startup of squid, you have to create swap directories as,
# /usr/local/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 [email protected] or [email protected]
Start squid in non-deamon and debug mode as,
# /usr/local/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,
# /usr/local/squid/sbin/squid -NCd10 -D
e) Starting Squid in Daemon Mode
Start squid in daemon as,
# /usr/local/squid/sbin/squid
f) Stopping / Reconfiguration / status check on squid
To stop squid,
# /usr/local/squid/sbin/squid -k shutdown
To reconfigure squid configuration file of squid.conf,
# /usr/local/squid/sbin/squid -k reconfigure
To check whether squid is running or not,
# /usr/local/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,
# /usr/local/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.
Sample script: http://www.faqs.org/docs/securing/chap28sec233.html
Disclaimer:
Please get back to us with your queries or feedbacks or issues using [email protected] or [email protected].
Site: www.geocities.com/squidrunner_dev/