Squid NT for Windows (Win32) daily administration

Squid on Windows is quite stable.  I am running a Squid 2.6 on a Windows server 2003 without  much problem.  Here's some of the tips for installation and maintenance.
  • To download
    • Go to Acme Consulting download page.  I am using their Squid 2.6.STABLE12  build and is quite stable for the over 5 years.
  • Installation
    • Please follow Acme's or Markus' instruction.  Important points are higlighted here:
      • copy the required files
      • copy the 3 conf files to respective location with correct file name
      • create the all the folders
      • create cache folder structure: 
        • squid -z -f
      • register squid as a Windows service (here assume the desired windows service name is default "squid", and assume the path is c:\squid so that no need to specify)
        • squid -i


The below script may help daily administration:

Service Restart

-- squid_restart.bat--
net stop squid
net start squid

Check config file correctness before apply it.

-- squid - check config.bat --
C:\squid\sbin\squid -k check -n Squid

(Note: always backup a copy of a valid squid.conf before edit.)

Apply new config

Apply the new config without restart the service.
-- squid - reconfig.bat --
C:\squid\sbin\squid -k reconfigure -n Squid

Clear old cache, recreate cache directory and defrag the disk for performance

-- squid - Recreate cache directory.bat --
@echo off
del /s /q d:\squidcache-del >nul
rd /s /q d:\squidcache-del > nul
echo Finish delete

echo Stopping squid 
net stop squid
move d:\squidcache d:\squidcache-del
cd C:\squid\sbin

echo recreating Squid cache directory
squid -z
echo restarting squid .... 
net start squid

echo Deleting old Squid Cache directory ....  
del /s /q d:\squidcache-del >nul
rd /s /q d:\squidcache-del > nul

echo end delete cache:
echo start defrag D
defrag d:
echo end defrag D.  Start defrag C:

defrag c:
echo end defrag C:


Popular Posts