发新话题
打印

[squid] 求助:安装完squid后问题很多

求助:安装完squid后问题很多

1,/usr/local/squid/etc/squid.conf 和/etc/squid/squid.conf两个文件应该配置哪一个?
2,两个人我都配置成一样的了
服务器IP:211.111.11.11
http_port 8080
cache_peer 211.111.11.11 parent 80 0 no-query

访问http://211.111.11.11:8080/php/test.html为什么不行?在/usr/local/squid/var/logs/access.log中为:
210.192.101.86 - - [05/May/2008:21:53:43 +0800] "GET http://211.11.11.11:8080/php/test.html HTTP/1.1" 403 1400 "-" "Mozilla/4.0 (co
mpatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; InfoPath.1)" TCP_DENIED:NONE
3,哪位大侠给个注释详细点的配置信息,我弄了三天了,头都大了!谢谢!!!!

TOP

没人知道吗?

TOP

我来回答第一个,简单点,呵呵

如果是自己手工编译的squid,配置文件是/usr/local/squid/etc/squid.conf
如果是用rpm安装的squid,配置文件就是和/etc/squid/squid.conf
Linuxpk -- 全球最大中文开源门户

TOP

从你看的日志可以看出,你用的是/usr/local/squid,请检查你的acl设置。
如果可以的话,你把配置文件贴出来。上面的信息不足以判断问题所在。
生活的理想是理想的生活!

TOP

谢谢两位的回答!
IE中打开http://211.157.10.71:8080/php/test.html
错误是
ERROR
The requested URL could not be retrieved

While trying to process the request:

GET /php/test.html HTTP/1.1
Host: 211.157.10.71:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: zh-cn,zh;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: gb2312,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: cck_count=1; cck_lasttime=1210036552156; AJSTAT_ok_times=49



The following error was encountered:

    * Invalid Request

Some aspect of the HTTP Request is invalid. Possible problems:

    * Missing or unknown request method
    * Missing URL
    * Missing HTTP Identifier (HTTP/1.0)
    * Request is too large
    * Content-Length missing for POST or PUT requests
    * Illegal character in hostname; underscores are not allowed

Your cache administrator is webmaster.
Generated Tue, 06 May 2008 14:45:17 GMT by 211.157.10.71 (squid/2.6.STABLE1)

我是手动编译的,下面是我的squid .conf
http_port 8080
icp_port 0
cache_peer 211.157.10.71 parent 80 0 no-query no-digest originserver
acl QUERY urlpath_regex cgi-bin \?
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_mem 32 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size_in_memory 64 KB
cache_dir ufs /usr/local/squid/var/cache 100 16 256
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
cache_log /usr/local/squid/var/logs/cache.log
cache_store_log none
emulate_httpd_log on
refresh_pattern ^ftp:                1440        20%        10080
refresh_pattern ^gopher:        1440        0%        1440
refresh_pattern .                0        20%        4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 8080        # http
acl Safe_ports port 80                # http
acl Safe_ports port 21                # ftp
acl Safe_ports port 443 563        # https, snews
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
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow all
http_access deny all
icp_access allow all
http_reply_access allow all
cache_effective_user squid
cache_effective_group squid
visible_hostname 211.157.10.71
coredump_dir /usr/local/squid/var/cache

TOP

问题解决没有呀!
Linuxpk -- 全球最大中文开源门户

TOP

从你的浏览器访问信息看出,可能是originserver的问题,数据从源取不到。
再一个你的acl写的有点逻辑问题,建议看看acl。
如果方便,把你的vaccess.log和error.log发出来看看。
生活的理想是理想的生活!

TOP

直接访问squid的ip请求是错误的,把你的加速域名写在自己的hosts文件里,加速域名对应的ip为squid的ip,然后再通过域名去访问,这样请求就合法了。
----

TOP

发新话题