squid普通代理求助
本帖最后由 12fzm34 于 2011-05-16 21:28 编辑
环境:Vmware7.1虚拟机环境
Linux:Rhl6.0_x64 eth0:10.0.0.3
Win2003 eth0:10.0.0.4
Squid_3.1.4_l.el6.x86_64用的是rpm包安装。
现在做一般代理,linux能够上网,win2003代理填写的10.0.0.3端口8888,能够在win2003上ping通linux的eth0的10.0.0.3,但是用代理上网不能,以下是squid.conf里的配置:已经快疯掉了!有谁能帮我一下,后面还要配置方向代理,这都不通后面更不好配了。谢谢谢谢!!!
#
# Recommended minimum configuration:
#
acl win src 10.0.0.4/32
http_access allow win
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl localhost src ::1/128
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl to_localhost dst ::1/128
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
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
#
# Recommended minimum Access Permission configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access allow manager
# Deny requests to certain unsafe ports
http_access allow !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access allow CONNECT !SSL_ports
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost
# And finally deny all other access to this proxy
http_access deny all
# Squid normally listens to port 3128
http_port 8888 vhost vport
# We recommend you to use at least the following line.
hierarchy_stoplist cgi-bin ?
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 100 16 256.
# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid
# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
#cache_mem
cache_mem 128 MB
#cache_mgr
cache_mgr root@example.com
#visible_hostname
visible_hostname squids
dns_nameservers 202.103.24.68
启动过程没有问题,防火墙已关闭,修改了下配置文件,现在客户机可以访问代理了
但是提示下面错误:
当尝试取回该 URL 时遇到下面的错误:http://www.163.com/
目前无法将您的请求进行转送操作
您的请求无法被转送到原始网络服务器或其他的上层缓存服务器,发生这个问题最可能的原因是缓存服务器管理员不允许本服务器与原始网络服务器直接连结,而 所有本服务器指定的上层缓存服务器都暂时无法连结。
缓存服务器的管理员 root@example.com.
这是cache.log的内容:
2011/05/14 03:24:43| never_direct = 0
2011/05/14 03:24:43| timedout = 0
2011/05/14 03:24:54| Failed to select source for 'http://www.sina.com.cn/'
2011/05/14 03:24:54| always_direct = 0
2011/05/14 03:24:54| never_direct = 0
2011/05/14 03:24:54| timedout = 0
2011/05/14 03:24:54| Failed to select source for 'https://www.wenjiangs.com/wp-content/uploads/chinaunix/202207/SN.png'
2011/05/14 03:24:54| always_direct = 0
2011/05/14 03:24:54| never_direct = 0
2011/05/14 03:24:54| timedout = 0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
squid服务器的ip转发开启了没有
本帖最后由 12fzm34 于 2011-05-15 17:42 编辑
回复 2# chenyx
这个是要开还是要关闭?我现在不知道我的开了还是关闭了,要是关怎么关?要是开怎么开呢?我刚才查了下还不知道怎么调试,我完全是从0开始配置linux服务器!
我把vim /etc/resolv.conf 中编辑成这样了nameserver 202.103.24.68,也还是同样出现上面的情况,防火墙也关闭了
vim /etc/sysctl.conf中的net.ipv4.ip_forward = 0修改成1了,不知道这是不是就是开启了ip转发,问题依旧!
/etc/sysctl.conf修改完成,用sysctl -p才启用
本帖最后由 12fzm34 于 2011-05-15 18:06 编辑
回复 4# chenyx
这个是sysctl -p后的结果!!
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
还是不行
我以为是acl规则的问题,在squid.conf里面加入了acl win src 10.0.0.4/32 http_access allow win,10.0.0.4是客户机的ip!问题依旧
你的服务器os是什么,如果是redhat(centos),关闭selinux,重启下squid服务看看
回复 6# chenyx
我用的红帽子企业版6.0x64的系统,selinux没有运行!要是运行的话,squid服务无法启用
http_access allow !Safe_ports 这个是不是反了。。
回复 8# dexter_yccs
这个http_access allow !Safe_ports ,我改成deny也不行!之前就试过了
回复 9# 12fzm34
你最后是allow all啊。。。