Server Topic
   >  Introduction to Proxying
   >  Server Side Installation
   >  Server Side Configuration
   >  Configuring Proxy Clients
   >  Troubleshooting Proxy Problems


Troubleshooting Squid HTTP Proxy Problems

Squid Log Files

If you encounter problems with Squid, the first place to look is in the log files. There are three types of log file and their locations are specified in the /etc/squid/squid.conf file by the following directives:

#  TAG: access_log
#       These files log client request activities. Has a line every HTTP or
#       ICP request. The format is:
#       access_log <filepath> [<logformat name> [acl acl ...]]
#       access_log none [acl acl ...]]
#       Will log to the specified file using the specified format (which
#       must be defined in a logformat directive) those entries which match
#       ALL the acl's specified (which must be defined in acl clauses).
#       If no acl is specified, all requests will be logged to this file.
#       To disable logging of a request use the filepath "none", in which case
#       a logformat name should not be specified.
#       To log the request via syslog specify a filepath of "syslog":
#       access_log syslog[:facility.priority] [format [acl1 [acl2 ....]]]
#       where facility could be any of:
#       authpriv, daemon, local0 .. local7 or user.
#       And priority could be any of:
#       err, warning, notice, info, debug.
access_log /var/log/squid/access.log squid

#  TAG: cache_log
#       Cache logging file. This is where general information about
#       your cache's behavior goes. You can increase the amount of data
#       logged to this file with the "debug_options" tag below.
# cache_log /var/log/squid/cache.log

#  TAG: cache_store_log
#       Logs the activities of the storage manager.  Shows which
#       objects are ejected from the cache, and which objects are
#       saved and for how long.  To disable, enter "none". There are
#       not really utilities to analyze this data, so you can safely
#       disable it.
# cache_store_log /var/log/squid/store.log

The three log files are shown below (-the default location is under /var/log/squid):

$ ls -lrt /var/log/squid
total 92
-rw-r----- 1 proxy proxy  4720 2011-02-24 11:07 store.log
-rw-r----- 1 proxy proxy 76353 2011-02-24 11:07 cache.log
-rw-r----- 1 proxy proxy  1530 2011-02-24 11:07 access.log

Testing Using "squidclient"

You can install the squidclient test program using the command:

$ sudo apt-get install squidclient

For example:

$ sudo apt-get install squidclient
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed
0 upgraded, 1 newly installed, 0 to remove and 21 not upgraded.
Need to get 33.9kB of archives.
After this operation, 119kB of additional disk space will be used.
Get:1 maverick-updates/universe squidclient i386 3.1.6-1.1ubuntu1.1 [33.9kB]
Fetched 33.9kB in 0s (132kB/s)     
Selecting previously deselected package squidclient.
(Reading database ... 150617 files and directories currently installed.)
Unpacking squidclient (from .../squidclient_3.1.6-1.1ubuntu1.1_i386.deb) ...
Processing triggers for man-db ...
Setting up squidclient (3.1.6-1.1ubuntu1.

This can now be used to retrieve a test URL from the Squid server, with the syntax:

squidclient -h <Squid Server> -p <Squid Port> <Test URL>

For example:

squidclient -h myServer -p 1234

The (HTML) source of the page should be returned (-and you should see a new entry in the /var/log/squid/access.log file) : if it is not, then there is a problem with the server configuration.

References and Further Reading:

HomeSite IndexDesktop GuideServer GuideHints and TipsHardware CornerVideo SectionContact Us

 sitelock verified Firefox Download Button