歡迎您光臨本站 註冊首頁

squid2.6.14隻能代理不能緩存!!特急

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

squid2.6.14隻能代理不能緩存!!特急

大家好,我安裝 了,squid 2.6.14版本的,可是安裝好之後,發現只能代理不能緩存任何頁面以及圖片等,請各位幫忙解決一下,在些先謝過了,如下我的squid.conf內容:
http_port 80 vhost vport=80
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_mem 1024 MB
maximum_object_size 4096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 256 KB
cache_dir ufs /var/spool/squid 20480 16 256
cache_swap_low 80
cache_swap_high 97
strip_query_terms off
request_body_max_size 5 MB
memory_pools on
memory_pools_limit 50 MB
access_log none
cache_log /var/log/squid/cache.log
cache_store_log none
pid_filename /var/run/squid.pid
hosts_file /etc/hosts
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i 9000net.net 240 100% 1440 reload-into-ims
refresh_pattern -i www.900net.net 240 100% 1440 reload-into-ims
refresh_pattern -i \.gif 180 20% 10080 reload-into-ims
refresh_pattern -i \.jpg 180 20% 10080 reload-into-ims
refresh_pattern \. 120 50% 2880 reload-into-ims
refresh_pattern www.lovecdn.cn 200 100% 1400 reload-into-ims
refresh_pattern -i lovecdn.cn 240 100% 1440 reload-into-ims
refresh_pattern -i \.bmp$ 60 50% 120 reload-into-ims
refresh_pattern -i \.jsp$ 1440 90% 129600 reload-into-ims
refresh_pattern -i \.htm$ 1440 90% 129600 reload-into-ims
refresh_pattern -i \.html$ 1440 90% 129600 reload-into-ims
refresh_pattern -i \.asp$ 1440 90% 129600 reload-into-ims
acl all src 0.0.0.0/0.0.0.0
acl p-manager proto cache_object
acl s-localhost src 127.0.0.1/255.255.255.255
acl d-localhost dst 127.0.0.0/8
acl d-domains dstdomain .163.com .9000net.net .apache.org .linuxfans.org .lovecdn.cn .rednetunion.com
acl p-ssl port 443 563
acl p-safe port 80 443 563
acl m-conn method CONNECT
acl m-purge method PURGE
acl n-maxconn maxconn 15
http_access allow p-manager s-localhost
http_access allow m-purge
http_access deny  !p-safe
http_access deny  m-conn !p-ssl
http_access deny  n-maxconn
http_access allow p-manager
http_access allow d-domains
http_access deny  all
http_reply_access allow all
acl r-url urlpath_regex realtime
acl QUERY urlpath_regex cgi-bin \?
cache deny r-url
cache allow QUERY
icp_access allow all
follow_x_forwarded_for allow all
acl_uses_indirect_client offrange_offset_limit -1
dns_timeout 2 seconds
forward_timeout 10 seconds
connect_timeout 10 seconds
peer_connect_timeout 6 seconds
read_timeout 10 seconds
request_timeout 6 seconds
persistent_request_timeout 16 seconds
cache_mgr huizhendong@cdnlive.cn
cache_effective_user nobody
cache_effective_group nobody
visible_hostname www.lovecdn.cn
logfile_rotate 0
always_direct allow all
error_directory /usr/local/squid/share/errors/Simplify_Chinese
coredump_dir /var/spool/squid
以上這些的squid.conf配置信息。
squid -v輸出如下:
# ./squid -v
Squid Cache: Version 2.6.STABLE14
configure options: '--prefix=/usr/local/squid' '--enable-follow-x-forwarded-for' '--enable-storeio=aufs,ufs' '--with-maxfd=65536' '--with-pthreads' '--enable-dlmalloc' '--enable-poll' '--enable-stacktraces' '--enable-removal-policies=heap,lru' '--enable-delay-pools'
以上是squid -v輸出內容。
以下是cache.log內容:
2007/07/27 08:18:17| Squid Cache (Version 2.6.STABLE14): Exiting normally.
2007/07/27 08:19:10| Starting Squid Cache version 2.6.STABLE14 for i686-pc-linux-gnu...
2007/07/27 08:19:10| Process ID 1870
2007/07/27 08:19:10| With 1024 file descriptors available
2007/07/27 08:19:10| Using poll for the IO loop
2007/07/27 08:19:10| Performing DNS Tests...
2007/07/27 08:19:10| Successful DNS name lookup tests...
2007/07/27 08:19:10| DNS Socket created at 0.0.0.0, port 39701, FD 4
2007/07/27 08:19:10| Adding nameserver 202.96.209.133 from /etc/resolv.conf
2007/07/27 08:19:10| Adding nameserver 202.96.209.5 from /etc/resolv.conf
2007/07/27 08:19:10| Adding domain localhost from /etc/resolv.conf
2007/07/27 08:19:10| Unlinkd pipe opened on FD 8
2007/07/27 08:19:10| Swap maxSize 20971520 KB, estimated 1613193 objects
2007/07/27 08:19:10| Target number of buckets: 80659
2007/07/27 08:19:10| Using 131072 Store buckets
2007/07/27 08:19:10| Max Mem  size: 1048576 KB
2007/07/27 08:19:10| Max Swap size: 20971520 KB
2007/07/27 08:19:10| Store logging disabled
2007/07/27 08:19:10| Rebuilding storage in /var/spool/squid (CLEAN)
2007/07/27 08:19:10| Using Least Load store dir selection
2007/07/27 08:19:10| Set Current Directory to /var/spool/squid
2007/07/27 08:19:10| Loaded Icons.
2007/07/27 08:19:11| Accepting accelerated HTTP connections at 0.0.0.0, port 80, FD 9.
2007/07/27 08:19:11| Accepting ICP messages at 0.0.0.0, port 3130, FD 10.
2007/07/27 08:19:11| WCCP Disabled.
2007/07/27 08:19:11| Ready to serve requests.
2007/07/27 08:19:11| Done reading /var/spool/squid swaplog (0 entries)
2007/07/27 08:19:11| Finished rebuilding storage from disk.
2007/07/27 08:19:11|         0 Entries scanned
2007/07/27 08:19:11|         0 Invalid entries.
2007/07/27 08:19:11|         0 With invalid flags.
2007/07/27 08:19:11|         0 Objects loaded.
2007/07/27 08:19:11|         0 Objects expired.
2007/07/27 08:19:11|         0 Objects cancelled.
2007/07/27 08:19:11|         0 Duplicate URLs purged.
2007/07/27 08:19:11|         0 Swapfile clashes avoided.
2007/07/27 08:19:11|   Took 1.0 seconds (   0.0 objects/sec).
2007/07/27 08:19:11| Beginning Validation Procedure
2007/07/27 08:19:11|   Completed Validation Procedure
2007/07/27 08:19:11|   Validated 0 Entries
2007/07/27 08:19:11|   store_swap_size = 0k
2007/07/27 08:19:11| storeLateRelease: released 0 objects

本人QQ:568383767,Email:huichrist@163.com.等候…………………………
《解決方案》

你怎麼知道不緩存的?

你看看你的日誌,是不是每一條都緩存了?
《解決方案》

在哪呢?我怎麼也沒看出來呢?HonestQiao能不能講解一下?謝謝了.
《解決方案》

請看置頂的常用命令帖

關於查看緩存情況的,關於緩存命中率的。
《解決方案》

看日誌文件access.log
《解決方案》

查看你的日誌文檔。
#more /usr/local/squid/var/logs/access.log | grep TCP_MEM_HIT
該指令可以看到在squid運行過程中,有那些文件被squid緩存到內存中,並返回給訪問用戶。
#more /usr/local/squid/var/logs/access.log | grep TCP_HIT
該指令可以看到在squid運行過程中,有那些文件被squid緩存到cache目錄中,並返回給訪問用戶。
#more /usr/local/squid/var/logs/access.log | grep TCP_MISS
該指令可以看到在squid運行過程中,有那些文件沒有被squid緩存,而是現重原始伺服器獲取並返回給訪問用戶。
關於 TCP_XXXX 等參數及代表的信息,請參看《squid中文權威指南》13.2.1 章節。

[火星人 ] squid2.6.14隻能代理不能緩存!!特急已經有411次圍觀

http://coctec.com/docs/service/show-post-36866.html