访问Internet上的Web服务器
1. 访问Internet上的Web服务器
1.1. 实例总图
在Kongming20上运行wget客户端程序,在ernest-laptop上运行代理服务器程序。客户端通过代理服务器的中专,获取Internet上的主机www.baidu.com的index.html。
为了将ernest-laptop设置为Kongming20的HTTP代理服务器,需要在kongming20上设置环境变量http_proxy:
export http_proxy="ernest-laptop:3128" 在客户端机子上执行
我这里代理服务器的主机为192.168.44.133
。
1.2. 部署squid代理服务器
在代理服务器上部署squid服务器。具体步骤见:
打开squid服务
此时,我这里的设置为
acl localnet src 192.168.44.0/24
http_access allow localnet