LinuxSir.cn,穿越时空的Linuxsir!

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

在Slackware 10 下做SQUID代理服务的问题

[复制链接]
发表于 2004-9-8 16:38:52 | 显示全部楼层 |阅读模式
如果在客户机浏览器设置代理服务器就可以上得到网,但如果做透明代理就不行,什么原因?但是客户机又通PING得通网址,真奇怪.按下面出错的提示应该是squid.conf的设置有问题吧,各位能否指点一二.
显示如下:
ERROR
The requested URL could not be retrieved

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

While trying to retrieve the URL: /

The following error was encountered:

Invalid URL
Some aspect of the requested URL is incorrect. Possible problems:

Missing or incorrect access protocol (should be `http://'' or similar)
Missing hostname
Illegal double-escape in the URL-Path
Illegal character in hostname; underscores are not allowed
Your cache administrator is webmaster.



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

Generated Wed, 08 Sep 2004 08:12:34 GMT by SLW10.Supercool (squid/2.5.STABLE6)

我的squid.conf文件内容如下:
http_port 3128
cache_mem 64 MB
cache_dir ufs /var/squid/cache 2000 16 256
http_access allow all
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

下面是做NAT的设置:
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to 192.168.1.12
发表于 2004-9-8 18:05:29 | 显示全部楼层
错误贴详细些,好像修改过LOG?你说的设置代理服务器是指设置为SQUID吗?
 楼主| 发表于 2004-9-8 19:45:46 | 显示全部楼层

错误就是上面贴的,已经是一字不漏了

错误就是上面贴的,已经是一字不漏了。
设置代理服务器是指设置为SQUID
就是在浏览器里指定代理服务器就能上网。
透明代理就是不用在浏览器里做任何设置的,就上不了。

下面是做NAT的设置:
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128

iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to 192.168.1.12
发表于 2004-9-8 21:50:17 | 显示全部楼层
指定代理服务器就能上网。
是指定的那个代理?是linux网关?还是外网的!
 楼主| 发表于 2004-9-9 12:08:06 | 显示全部楼层

是linux网关

是linux网关
 楼主| 发表于 2004-9-9 12:09:45 | 显示全部楼层

是linux网关

192.168.0.1:3128
发表于 2004-9-9 17:27:09 | 显示全部楼层
加上一句httpd_accel_host virtual
试试。另外把iptables 中的那-m tcp去掉试试.

看样子是你的配置文件没有写好。
发表于 2004-9-9 20:38:18 | 显示全部楼层
faint的squid用的出神了。。。。高手。。。
 楼主| 发表于 2004-9-10 09:17:27 | 显示全部楼层

谢了!!

谢谢faint!!
行了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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