Saya mencoba mengkonfigurasi Squid sebagai server caching. Saya memiliki LAN di mana server web (apache) di 192.168.122.11
squid berada di 192.168.122.21
dan klien saya ada di 192.168.122.22
. Masalahnya adalah, ketika saya melihat log akses Squid, yang saya lihat hanyalah TCP_MISS
pesan. Sepertinya Squid sama sekali bukan caching. Saya memeriksa bahwa direktori cache memiliki semua izin yang tepat. Apa lagi yang salah di sini? Ini konfigurasi squid saya:
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
Di semua mesin, cona-proxy
arahkan ke 192.168.122.21
(menambahkan bahwa dalam /etc/hosts
)
Output dari 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