calin radoni's humble web presence

homedocstoolboxabout

Squid Usefull Tasks

Table of Contents

Introduction

Most of the time the Squid Web Proxy Cache needs no user intervention. However, from time to time some tasks are need to be performed. As an example I could mention log rotation and cache cleaning.

General stuff

In my case, if I am remeber correctly I have installed squid by compiling the source code using the default path options, squid is installed in the /usr/local/squid directory.

The configuration repository is located under the /usr/local/squid/etc directory. The main configuration file is squid.conf.

I have a separate partition, mounted under the /var/squid directory. In this partition I have two directories, one for cache and one for logs.

The squid's cache directory, /var/squid/cache, contains the cache subdirectories and the swap log file, swap.state.

The squid's logs directory, /var/squid/logs, contains, among others, the access.log, cache.log and store.log files.

Note

All references that may include paths, across this document, will be made by using the paths mentioned above.

Rotating Squid's Logs

The procedure is quite simple, it can be done manually by issuing the command:

# /usr/local/squid/bin/squid -k rotate
							
or automatically, by using a cron job:
0 0 * * * /usr/local/squid/bin/squid -k rotate
							

Rotating squid's logs is usefull for analyzing them before they get too big. And, of course, saving disk space by compressing or deleting the old, unneeded ones.

Cleaning the Squid's Cache

First you must stop the squid application:

# /usr/local/squid/bin/squid -k shutdown
							
remove the cache folders:
# cd /var/squid/cache/
# rm -rf ./??
							
and cleanup the swap log file by issuing this command:
# echo "" > /var/squid/cache/swap.state
							

Now you have to recreate the cache directories:

# /usr/local/squid/bin/squid -z
							
and start squid:
# /usr/local/squid/bin/squid &
							

More to come

Descriptions for more tasks will be written as soon as I will need to do those...

You may want to read my document about Squid: Blocking Unwanted Sites

History

Copyright and License

This document is copyrighted (c) 2005 by Calin Radoni. Permission is granted to copy and/or distribute this document.

Disclaimer

No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies that could be damaging to your system. Proceed with caution, the author do not take any responsibility.

All copyrights are held by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.


Copyright © 2005 - 2009 Calin Radoni Hosted on http://www.oocities.org/calinradoni Last page modification is 14 July 2005