LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 752|回复: 9

关于squid的问题,大家帮帮忙~~

[复制链接]
发表于 2004-5-25 00:27:55 | 显示全部楼层 |阅读模式
在开启网页的时候出现如下错误:

ERROR
The requested URL could not be retrieved

--------------------------------------------------------------------------------

While trying to retrieve the URL: http://www.google.com/

The following error was encountered:

Connection Failed
The system returned:

    (110) Connection timed outThe remote host or network may be down. Please try the request again

希望大虾指点~~~
 楼主| 发表于 2004-5-25 00:32:23 | 显示全部楼层

我的/etc/squid.conf/配置如下

http_port       3128    8080
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 32 MB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/squid/var/cache 100 16 256
client_netmask 255.255.255.255
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
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 CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl nu src 202.115.22.147
acl badurl url_regex -i sex
http_access deny badurl
http_access allow nu
http_access deny all
http_access deny all
http_reply_access allow all
icp_access allow all
cache_mgr xxxxx@xxxxx.com
visible_hostname xxxx
coredump_dir /var/squid/var/cache
 楼主| 发表于 2004-5-25 00:40:51 | 显示全部楼层

我的/etc/squid.conf/配置如下

http_port       3128    8080
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 32 MB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/squid/var/cache 100 16 256
client_netmask 255.255.255.255
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
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 CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl nu src 202.115.22.147
acl badurl url_regex -i sex
http_access deny badurl
http_access allow nu
http_access deny all
http_access deny all
http_reply_access allow all
icp_access allow all
cache_mgr xxxxx@xxxxx.com
visible_hostname xxxx
coredump_dir /var/squid/var/cache
发表于 2004-5-25 16:05:35 | 显示全部楼层
1. 你的squid以源码形式安装的?RPM包安装的话,其配置文件一般为/etc/squid/squid.conf

2. 使用默认的配置文件,在浏览器代理服务器设置里输入127.0.0.1,端口3128没有任何问题.

3. 把你上面的配置文件拷贝过来做我的配置文件,重启squid后出现的是Access Denied的错误信息,在http_access deny all前加入2行:
acl my_lan_network src 192.168.0.0/24
http_access allow my_lan_network

重启squid,测试:(假设我的IP地址为192.168.0.18)
在浏览器代理服务器设置里输入192.168.0.18,端口3128, 访问网页正常
但是用127.0.0.1却不行,真是莫名其妙.

4. 估计可能大概maybe possible likely是由于防火墙的原因吧
 楼主| 发表于 2004-5-25 17:24:08 | 显示全部楼层

现在的问题更奇怪了

首先谢谢楼上的朋友!

后来我加上父级代理
cache_peer xxx.xxx.xxx.xxx        parent  80      3130    proxy-only
就可以用了,本来我的代理服务器也不能上外网的,我只是在shell里面设置了proxy。

但是,更加奇怪的是,我通过客户端上外网,网页只能打开一次,比如上google,就只能停在google首页而不能查询。。。。无语了。。。:confused:
 楼主| 发表于 2004-5-25 19:39:17 | 显示全部楼层
自己顶~~~
 楼主| 发表于 2004-5-26 16:16:52 | 显示全部楼层
新情况:
     可以正常浏览网页,但是google没法搜索,hotmail打不开,大家帮忙分析一下是什么情况吧~~~小弟先谢过各位了~~~:thank
 楼主| 发表于 2004-5-27 00:18:18 | 显示全部楼层
经过抓包,结果表明在搜索的时候,本机绕过代理服务器直接向外网发包。。。这是怎么回事。。。。
 楼主| 发表于 2004-5-27 09:13:15 | 显示全部楼层
呵呵,自己解决了,但是有些问题还是不清楚。
    之前我抓包看了看,发现在用google搜索的时候没有通过上级代理,而是客户机试图直接和google链接,配置了 never_direct allow(它的作用是把所有包全部转发到父级代理)之后问题解决。
    但是还有些细节我不清楚,比如为什么只是搜索不能用,因为按我事后的理解,之前二级代理的作用只是简单的提供客户机和外网的链接,之后的事情它就应该不管了,所以才会出现搜索不到的情况,但是打开的外网网页里面的其他链接都可以用,很奇怪,不知道各位有没有兴趣研究一下。
发表于 2004-5-27 14:30:25 | 显示全部楼层
acl badurl url_regex -i sex
http_access deny badurl
http_access allow nu
http_access deny all
http_reply_access allow all
icp_access allow all
------------------------
把红色地方改为
http_access allow all
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表