Trouble getting Squid running - is it a Bug?


Can't get squid to initialize the cache directory.

Your Squid cache directory /var/spool/squid3 has not been initialized.This must be done before Squid can be run.

Clicking the Intialize Cache button yields this...

Error - Perl execution failed

Can't use string ("Directory-Name") as a HASH ref while "strict refs" in use at line 118.

...which I've googled and tried a couple of things, such as changing permissions of the cache directory and the suggestion here about uncommenting this line in the .conf

cache_dir ufs /usr/local/squid/var/cache/squid 100 16 256

(although my cache_dir line did not look like that). None of that helped. So I wonder if there is a trick someone here can help me with?





Could be Webmin is parsing the Squid config file incorrectly. Can you post the output from the command :

grep cache_dir squid.conf

so I can see all commented and un-commented lines?

Thanks Jamie. Here's the output...

/etc/squid3# grep cache_dir squid.conf

# Applies to any cache_dir lines listed below this.
#  TAG: cache_dir
# cache_dir Type Directory-Name Fs-specific-data [options]
# You can specify multiple cache_dir lines to spread the
# cache_dir ufs Directory-Name Mbytes L1 L2 [options]
# cache_dir aufs Directory-Name Mbytes L1 L2 [options]
# cache_dir diskd Directory-Name Mbytes L1 L2 [options] [Q1=n] [Q2=n]
# block-size=n defines the "block size" for COSS cache_dir's.
# leads to a maximum cache_dir size of 512<<24, or 8 GB.  Note
# has written some objects to the cache_dir.
# no-store, no new objects should be stored to this cache_dir
# max-size=n, refers to the max object size in bytes this cache_dir
# supports.  It is used to select the cache_dir to store the object.
# the cache_dir lines with the smallest max-size value first and the
cache_dir ufs /var/spool/squid3 100 16 256
# 'cache_dir' directory, but you may specify an alternate
# a representation of the cache_dir name where each / is replaced
# with '.'. This is needed to allow adding/removing cache_dir
# If have more than one 'cache_dir', and %s is not used in the name
# corresponds to the order of the 'cache_dir' lines in this
# configuration file.  If you change the order of the 'cache_dir'
# the correct 'cache_dir' entry (unless you manually rename
# better to keep these index files in each 'cache_dir' directory.

Ok, this is a Webmin bug - it will be fixed in the next release.