我的squid怎麼就查看不了命中率呢?終於知道原因了,問題已經解決
完全是配置的問題,我使用的80埠本機傳遞,也就是說使用的是127.0.0.1的80埠作為web伺服器監聽埠,squid使用主機211.*.*.*的地址監聽80埠,導致不能查看命中率
原始配置如下:
http_port 100.100.100.100:80 accel vhost
visible_hostname www.abcd.cn
acl localhost src 127.0.0.1/32
acl local-servers dstdomain .abcd.cn
acl local-servers dstdomain vip.abcd.com
acl manager proto cache_object
acl ourdomain dstdomain .abcd.cn
acl ourdomain dstdomain vip.abcd.com
acl ournet dst 100.100.100.100/32 # RFC1918 possible internal network
acl ournet dst 127.0.0.1/32 # RFC1918 possible internal network
acl Safe_ports port 443 # https
acl Safe_ports port 80 # http
acl to_localhost dst 127.0.0.0/8
always_direct allow local-servers
cache_dir ufs /usr/local/squid/var/cache 1024 16 256
cache_log /usr/local/squid/var/logs/cache.log
cache_mem 256 MB
cache_store_log none
http_access allow manager localhost
http_access allow ourdomain
http_access allow ournet
http_access deny manager
http_access deny !Safe_ports
http_access deny all
logfile_rotate 10
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
access_log /usr/local/squid/var/logs/access.log combined
修改後的配置如下
http_port 100.100.100.100:80 accel vhost vpost
visible_hostname www.abcd.cn
acl localhost src 127.0.0.1/32
acl local-servers dstdomain .abcd.cn
acl local-servers dstdomain vip.abcd.com
acl manager proto cache_object
acl ourdomain dstdomain .abcd.cn
acl ourdomain dstdomain vip.abcd.com
acl ournet dst 100.100.100.100/32 # RFC1918 possible internal network
acl ournet dst 127.0.0.1/32 # RFC1918 possible internal network
acl Safe_ports port 443 # https
acl Safe_ports port 80 # http
acl to_localhost dst 127.0.0.0/8
cache_dir ufs /usr/local/squid/var/cache 1024 16 256
cache_log /usr/local/squid/var/logs/cache.log
cache_mem 256 MB
cache_store_log none
cache_peer 127.0.0.1 parent 81 0 no-query no-digest originserver name=www
cache_peer_domain www www.abcd.cn
cache_peer_access www allow all
http_access allow manager localhost
http_access allow ourdomain
http_access allow ournet
http_access deny manager
http_access deny !Safe_ports
http_access deny all
logfile_rotate 10
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
access_log /usr/local/squid/var/logs/access.log combined
我的squid怎麼就查看不了命中率呢? 我是squid反向代理resin3.15
./squidclient -p 80 -h 127.0.0.1 mgr:info
HTTP/1.0 404 Not Found
Server: Resin/3.1.5
Content-Type: text/html
Content-Length: 3435
Date: Mon, 23 Jun 2008 09:28:46 GMT
<HTML><HEAD><TITLE>Sorry! 你訪問的頁沒找到!</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META http-equiv=refresh content="10; url=http://www.abcd.com/">
<STYLE type=text/css>
......
<TD align=left background="/images/rbox_9.gif"
height=20></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>
squid.conf配置
acl localhost src 127.0.0.1/32
acl manager proto cache_object
http_access allow manager localhost
請大俠們幫忙分析一下
[ 本帖最後由 power328 於 2008-6-24 16:20 編輯 ]
《解決方案》
直接用squidclient -p 80 mgr:info呢,不加-h 127.0.0.1試試
《解決方案》
回復 #2 liuhanzhao 的帖子
squidclient -p 80 mgr:info呢,不加-h 127.0.0.1 我也測試了,不行的