Serving up multiple websites from same web server using Squid 2.7.

Primedius used Ask the Experts™
Right now we can only properly cache requests to "" set with the defaultsite parameter, any of the other sites hosted on webserver are not cached. Is this simply a matter of adding the vhost parameter to the end of the http_port command? See below:

acl all src all
acl manager proto cache_object
acl localhost src
acl to_localhost dst
acl webserver dst
http_access allow webserver
acl localnet src # RFC1918 possible internal network
acl localnet src # RFC1918 possible internal network
acl localnet src # RFC1918 possible internal network
http_access allow all
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access deny all
icp_access allow localnet
icp_access deny all

http_port accel defaultsite=
cache_peer parent 80 3130 no-query no-digest originserver

hierarchy_stoplist cgi-bin ?

cache_dir ufs g:\cache 5000 16 256
cache_replacement_policy lru
maximum_object_size 50096 KB

access_log c:/squid/var/logs/access.log squid
cache_log c:/squid/var/logs/cache.log
cache_store_log c:/squid/var/logs/store.log
max_stale 1 week
refresh_pattern . 2 20% 4320 override-expire
refresh_pattern /bus/ 15 75% 4320 override-expire
refresh_pattern /images/ 15 75% 4320 override-expire

acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache

forwarded_for on

coredump_dir c:/squid/var/cache

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
http_port accel defaultsite=

The above line tells squid to act as web server and listen to IP 192.168.114 socket 80. All requests to this ip and port are in turn made to the defaultsite
To accelerate multiple hosts add the following
httpd_accel virtual
and change the above line
http_port accel vhost defaultsite=


Thanks Tanmay but the directive "httpd_accel" does not seem to exist in Squid 2.7.
Have you tried changing the line
http_port accel defaultsite=
to read
http_port accel vhost defaultsite=

If it does not work this way then we may have to add another interface e.g. eth0:1 ip and add the line
http_port accel defaultsite=


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial