- 论坛徽章:
- 0
|
visible_hostname test.com
http_port 134.234.102.2:81 vhost vport
icp_port 0
cache_mem 200 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 20000 KB
maximum_object_size_in_memory 4096 KB
cache_dir ufs /usr/local/squid/var/cache 10000 16 256
cache_store_log none
emulate_httpd_log on
pid_filename /var/log/squid/squid.pid
cache_log /var/log/squid/cache.log
access_log /var/log/squid/access.log combined
acl all src 0.0.0.0/0.0.0.0
http_access allow all
acl QUERY urlpath_regex cgi-bin .cgi .avi .wmv .rm .ram .mpg .mpeg .zip .exe
cache deny QUERY
#acl picurl url_regex -i \.bmp$ \.png$ \.jpg$ \.gif$ \.jpeg$
#acl mystie1 referer_regex -i aaa
#http_access allow mystie1 picurl
#acl mystie2 referer_regex -i bbb
#http_access allow mystie2 picurl
#acl nullref referer_regex -i ^$
#http_access allow nullref
#acl hasref referer_regex -i .+
#http_access deny hasref picurl
cache_peer 134.234.102.2 parent 80 0 no-query originserver
cache_effective_user nobody
cache_effective_group nobody
squid安装过程没有出现错误提示.
(配置好squid, 配置文件在上面,然后squid -z 运行成功,但是在cache目录下没有自动生成目录.squid -s,启动成功. test.com已经在hosts里指定 134.234.102.2 test.com .apache我用的80端口.
因为我还有其他项目在服务器上,所以不能改APACHE 80端口,我就让squid用81端口来测试.
然后在本机下配置好hosts,在IE下访问 test.com是OK,但是test.com:81就不能访问. 怎么squid 没有起反向代理的作用呢? 我搞了好久了,希望有能力的朋友帮兄弟看看 . 兄弟在此谢谢了 ~ ^^ )
visible_hostname test.com
http_port 134.234.102.2:81 vhost vport
上面两句是指squid 监听服务器上test.com域名和服务器上81端口吗?
cache_peer 134.234.102.2 parent 80 0 no-query originserver
上面一句是指监听服务器上80端口,反向代理服务器上test.com域名80端口?
个人理解是,用户如果 test.com:81访问服务器,服务器上squid因该起反向代理作用,找缓存,如果没有就调
test.com:80 apache服务器的内容并缓存.
我的配置不成功,往达人指导我一下,看我的配置和想法是否哪有不对的地方. 小弟在此多谢了.
[ 本帖最后由 shangdi12 于 2007-9-7 16:32 编辑 ] |
|