免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 17243 | 回复: 6
打印 上一主题 下一主题

[proxy] 初次使用squid的问题(Access Denied) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-10 17:27 |只看该作者 |倒序浏览
Squid Cache: Version 2.6.STABLE16
configure options:

默认安装

执行了squid -z

以默认配置文件启动squid -d1,无明显错误信息

使用squidclient http://www.google.com测试,返回Access Denied的结果

配置文件如下(红字为自己添加的访问规则,ip地址192.168.0.x):
acl inter src 192.168.0.0/255.255.255.0
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
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
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 inter
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
icp_access allow all
http_port 3128


在此基础上添加访问规则
acl wan dst 0.0.0.0/0.0.0.0
http_access wan
后,使用squidclient http://www.google.com则可正常返回google页面

但是如果用其他客户端(IE),把代理服务器测为这台squid的ip地址,端口3128后,仍然不能访问

看之前的一些文档,说只要默认配置,基本可完成普通代理服务器功能,不知我错在何处,请教,多谢!!

论坛徽章:
0
2 [报告]
发表于 2007-12-10 22:06 |只看该作者
acl all src 0.0.0.0/0.0.0.0
acl inter src 192.168.195.0/24
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80          # http
acl Safe_ports port 443         # https
acl Safe_ports port 8080        # tomcat

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 inter
http_access deny all

请参考
不知道是不是和你的http_access位置放的有关系,你按我这个试试

论坛徽章:
0
3 [报告]
发表于 2007-12-11 09:15 |只看该作者
换成了ls的配置文件,还是说Access Denied

<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="http://www.sohu.com">http://www.sohu.com</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Access Denied.
</STRONG>
<P>
Access control configuration prevents your request from
being allowed at this time.  Please contact your service provider if
you feel this is incorrect.
</UL>
<P>Your cache administrator is <A HREF="mailto:webmaster">webmaster</A>.

论坛徽章:
2
2015年辞旧岁徽章
日期:2015-03-03 16:54:1515-16赛季CBA联赛之上海
日期:2016-05-05 09:45:14
4 [报告]
发表于 2007-12-11 10:32 |只看该作者
你是做什么代理的,?普通,还是透明!

论坛徽章:
0
5 [报告]
发表于 2007-12-11 11:12 |只看该作者
但是如果用其他客户端(IE),把代理服务器测为这台squid的ip地址,端口3128后,仍然不能访问  (这个问题已解决,原来是我IE上面代理服务器地址写错了),另外我发现当我加上wan出口规则,可以访问后,再把规则去掉,也可以访问了,真是奇怪了

论坛徽章:
0
6 [报告]
发表于 2007-12-11 11:28 |只看该作者
普通代理,现在好像一切都好了,有点莫名其妙的感觉

论坛徽章:
0
7 [报告]
发表于 2011-11-15 12:42 |只看该作者
同样问题,
加http_access allow all

http_access deny all
前面就好了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP