歡迎您光臨本站 註冊首頁

VMWARE6.0構建Squid2.6反向代理實驗環境

←手機掃碼閱讀     火星人 @ 2014-03-29 , reply:0

VMWARE6.0構建Squid2.6反向代理實驗環境

2008-07-24 CentOS5#撫琴煮酒

#####################################################
系統環境:真實主機為蕃茄花園XP_SP2+Vmware6.0

Squid伺服器:CentOS5.1,squid版本為2.6,二塊網卡,外網網卡VM5,IP:192.168.5.1,主機名為www.test.com

內網網卡VM0,IP:192.168.1.101

內網Web主機a:克隆的centOS5.1,內網網卡VM0,IP:192.168.1.103,域名為ns.test.com

內網Web主機b:克隆的centOS5.1,內網網卡VM0,IP:192.168.1.102,域名為mail.test.com

XP客戶機網卡VM5,IP:192.168.5.2

在XP主機下編輯文件 edit c:\windows\system32\drivers\etc\hosts

192.168.5.1 www.test.com

192.168.5.1 ns.test.com

192.168.5.1 mail.test.com

Squid配置文件如下:

#監聽伺服器的80埠,支持域名和IP的虛擬主機
http_port 192.168.100.100:80 vhost

#重點,反向代理的配置,以下內容在原有squid內容文件上添加
# 被代理的web的IP 父子關係 埠 icp或HTCP埠(0代表禁止) 自命名
cache_peer 192.168.100.103 parent 80 0 no-query originserver name=a
cache_peer 192.168.100.102 parent 80 0 no-query originserver name=b

#所代理的域名
cache_peer_domain a ns.test.com
cache_peer_domain b mail.test.com

#訪問許可權的控制
acl all src 0.0.0.0/0.0.0.0
http_access allow all
cache_peer_access a allow all
cache_peer_access b allow all

squid詳細流程圖解詳見我的另一篇文章http://hi.baidu.com/yuhongchun02 ... 826da4cd1166ac.html

[ 本帖最後由 yuhongchun 於 2008-7-27 20:57 編輯 ]

[火星人 ] VMWARE6.0構建Squid2.6反向代理實驗環境已經有390次圍觀

http://coctec.com/docs/linux/show-post-200955.html