J'essaie de configurer Squid en tant que serveur de mise en cache. J'ai un LAN où le serveur Web (apache) est à 192.168.122.11
squid est à 192.168.122.21
et mon client est à 192.168.122.22
. Le problème est que lorsque je regarde le journal d'accès de Squid, je ne vois que des TCP_MISS
messages. Il semble que Squid ne mette pas du tout en cache. J'ai vérifié que le répertoire cache possède toutes les autorisations appropriées. Quoi d'autre peut mal tourner ici? Voici ma config squid:
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.1/8 0.0.0.0/32 ::1
acl SSL_ports port 443
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
http_access allow all
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
http_port 3128 accel defaultsite=cona-proxy vhost
cache_peer 192.168.122.11 parent 80 0 no-query originserver login=PAS name=webserver
cache_dir ufs /var/spool/squid3 100 16 256
coredump_dir /var/spool/squid3
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
refresh_pattern . 0 20% 4320
always_direct allow all
acl server_users dstdomain cona-proxy
http_access allow server_users
cache_peer_access webserver allow server_users
cache_peer_access webserver deny all
Dans toutes les machines, cona-proxy
pointe vers 192.168.122.21
(ajouté que dans /etc/hosts
)
Sortie de curl -v 192.168.122.11
* About to connect() to 192.168.122.11 (#0)
* Trying 192.168.122.11... connected
> GET / HTTP/1.1
> User-Agent: curl/7.22.0 (i686-pc-linux-gnu) libculr/7.22.0 OpneSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: 192.168.122.11
> Accept: */*
>
< HTTP/1.1 202 OK
< Date Mon, 02 Jul 2012 05:48:50 GMT
< Server: Apache/2.2.22 (Ubuntu)
< Last-Modified: Tue, 19 Jun 2012 23:04:25 GMT
< ETag: "27389-b1-4c2db4dc2c182"
< Accept_Ranges: bytes
< Content-Length: 177
< Vary: Accept-Encoding
< Content-Type: text/html
< X-Pad: avoid browser bug
<
<html><body><h1>It works!</h1>
<p>This is the default web page for the server.</p>
<p>The web server software is running but no content has been added, yet. </p>
</body></html>
* Connection #0 to host 192.168.122.11 left intact
* Closing connection #0