免费注册 查看新帖 |

Chinaunix

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

[proxy] [已解决]执行squidclient的时候提示权限不足403 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-07-26 11:56 |只看该作者 |倒序浏览
本帖最后由 cfanbo 于 2011-07-26 15:07 编辑

[root@bogon bin]# ./squidclient -p 80 -m PURGE http://bbs.abc.com/index.htm
  1. HTTP/1.0 403 Forbidden
  2. Server: squid/3.0.STABLE25
  3. Mime-Version: 1.0
  4. Date: Fri, 22 Jul 2011 16:30:44 GMT
  5. Content-Type: text/html
  6. Content-Length: 1472
  7. X-Squid-Error: ERR_ACCESS_DENIED 0
  8. X-Cache: MISS from cnc12.34.56.78
  9. Via: 1.0 cnc12.34.56.78 (squid/3.0.STABLE25)
  10. Connection: close
复制代码
squid.conf配置:
  1. #Default:
  2. # windows_ipaddrchangemonitor on


  3. visible_hostname cnc12.34.56.78
  4. cache_mgr webmaster@abc.com
  5. http_port 80 vhost vport
  6. cache_mem 256 MB
  7. maximum_object_size_in_memory 2 MB
  8. memory_replacement_policy lru
  9. cache_dir ufs /usr/local/squid/var/cache 512 16 256
  10. max_open_disk_fds 0


  11. minimum_object_size 0 KB
  12. maximum_object_size 120 KB

  13. cache_swap_low 80
  14. cache_swap_high 97

  15. cache_store_log none

  16. cache_peer 192.168.0.90 parent 81 0 no-query no-digest originserver name=blog
  17. cache_peer 192.168.0.90 parent 81 0 no-query no-digest originserver name=bbs

  18. cache_peer_domain blog blog.abc.com
  19. cache_peer_domain bbs bbs.abc.com

  20. cache_peer_access blog allow all
  21. cache_peer_access bbs allow all

  22. [color=Blue]acl Purge method PURGE
  23. http_access allow Purge localhost[/color]

  24. http_access allow all
  25. cache_effective_user squid
  26. cache_effective_group squid

  27. httpd_suppress_version_string off
复制代码
/etc/host文件加了一条信息
192.168.0.90    bbs.abc.com

按照http://docs.haohtml.com/Squid/chap07.html#a6但要的方法加上
  1. acl AdminBoxes src 127.0.0.1 172.16.0.1 192.168.0.1
  2. acl Purge method PURGE
  3. http_access allow AdminBoxes Purge
  4. http_access deny Purge
复制代码
试了也不行

已经解决:
  1. [root@bogon bin]# ./squidclient -m PURGE -h 192.168.0.90 -p 80 http://bbs.abc.com
  2. HTTP/1.0 404 Not Found
  3. Server: squid/3.0.STABLE25
  4. Mime-Version: 1.0
  5. Date: Fri, 22 Jul 2011 19:45:06 GMT
  6. Content-Length: 0
  7. X-Cache: MISS from cnc12.34.56.78
  8. Via: 1.0 cnc12.34.56.78 (squid/3.0.STABLE25)
  9. Connection: close
复制代码
原来指定的时候用了127.0.0.1,换成192.168.0.90可以了,但不清楚为什么127.0.0.1不可以的,难道和cache_peer后面的ip有一定的关系吗?

论坛徽章:
0
2 [报告]
发表于 2011-07-26 14:30 |只看该作者
有点乱,有几点做好,理论上就应该可以执行squidclient:

1.http_access allow localhost
2.acl localhost src 添加本机IP
3.cachemgr.conf 中加入 主机名:8080

再执行看。

论坛徽章:
0
3 [报告]
发表于 2011-07-26 14:33 |只看该作者
squidclient用法例:

squidclient -h 10.10.10.10 -p 8080 mgr:info

论坛徽章:
0
4 [报告]
发表于 2011-07-26 15:05 |只看该作者
解决了
./squidclient -r -p 80 -h 192.168.0.90 http://bbs.abc.com/
原来没有指定-h参数,指定的时候,只用了127.0.0.1,换成192.168.0.90就可以了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP