Squid 2.6 in accelerator mode

I run Squid in accelerator mode — i.e. all http requests go through a Squid cache before being forwarded to Apache. This noticeably speeds up Wordpress on my puny virtual server. So today apt-get told me that a new version of Squid was out, and I blissfully upgraded from 2.5 to 2.6. An hour later I realized that my website was down. Restarting Squid yielded the error message
Restarting Squid HTTP proxy: squid2006/07/26 21:45:11| parseConfigFile: line 2218 unrecognized: 'httpd_accel_host virtual'

Some googling revealed the answer: Squid 2.6 uses a very different syntax for specifying accelerator mode. Now, how hard would it have been for Squid or Debian to warn me that the config file syntax was going to change? Or at least update the Squid FAQ to reflect the new syntax? I am sure there are quite a few people using the accelerator feature…

For the record, if your Squid forwards to Apache sitting on port 81 on the same machine, i.e. if your version 2.5 squid.conf setup looked like
http_port 80
httpd_accel_host virtual
httpd_accel_port 81

you will need to change it to something like
http_port 80 vhost
cache_peer 127.0.0.1 parent 81 0 no-query originserver

(and if you are starting off with a virgin 2.6 copy of squid.conf, don’t forget to configure your acls and http_access entries properly).

One Response to “Squid 2.6 in accelerator mode”

  1. Tetromino weblog » Blog Archive » Upgrading to apache-2.2 Says:

    […] So I run apt-get dist-upgrade, download a new version of apache, and suddenly going to http://www.tetromino.net/blog/ gives a 404 error. On closer examination, it seems that the new version of apache2.conf that came with the update does not have a DirectoryIndex directive, and as a result apache isn’t autoloading my blog’s index.php. Gotta tell you, I love the way Debian changes config files on you with no warning… […]

Leave a Reply