acl examample1 src 192.168.0.0/24
找到INSERT YOUR OWN RULE(S) HERE 增加下列一行:
http_access allow example1
7) 重启squid
# service squid restart有错?看日志。
8) 此时,机器2能够浏览server1.example1.com 或 internet网页.
9) 编辑/etc/squid/squid.conf ,在acl examample1 src 192.168.0.0/24行下添加
acl otherdeny dstdomain .sina.com.cn
在http_access allow example1下添加:
http_access deny otherdeny
10) 重启squid.
# service squid restart有错? 看日志。
11) 机器2,仍能浏览 http://www.sina.com.cn,为什么
12) 编辑/etc/squid/squid.conf ,把http_access deny otherdeny放到http_access allow example1前面,重启squid,机器2还能看到http://www.sina.com.cn吗
[实验总结]
Apache配置是否成功,与DNS有很大关系,所以,要求读者先花时间作好DNS工作。本文以最通俗的方式,教你简单的配置Apache,如果想深入掌握它,还得研究Apache2.0的文档。最近看到http://kajaa.bbs.us/ApacheManual/zh-cn/是kajaa老兄翻译成了Apache的中文文档,相信对大家一定有好处。