squid 代理服务器的配置实验
实验目的:1、普通代理服务器的配置
        2、透明代理服务器的配置
实验环境:一台linux代理服务器(双网卡)
   一台linux web服务器(单网卡)
   一台真机器XP
实验步骤:
一:IP地址规划
  linux代理服务器:内网:192.168.1.100(eth0)
    外网:192.168.2.88(eth1)

 Linux web服务器:iP:192.168.2.101
      xp  ip:192.168.1.88
二:安装好Web服务器,并测试启动成功。
三:安装squid软件包
四:配置普通代理实验,并在xp真 机器上测试是否可以通过代理访问web服务器(不要配置网关,ping不通web服务器却能正常访问web页面才正常)
五:配置透明式代理实验,并在xp真机器上测试不在IE浏览里指定代理是否可以访问web服务器,(xp真机器要配置网关,并且linux代理服务器上要些好防火墙脚本)

cache_dir ufs /var/spool/squid 100 16 256
cache_mgr [email]root@163.com[/email]
cache_effective_user squid
cache_effective_group squid
http_access all all
-------------------------------------------------
squid -z
hostname [url]www.abc.com[/url]
vi /etc/hosts
192.168.1.100   [url]www.abc.com[/url]        www
vi ip.sh
#/bin/bash
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
service iptables restart
echo "1" >/proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -s 192.168.1.0/24 -t tcp --dport -j REDIRECT  3128
iptables -t nat -A POSTROUTing -s 192.168.1.0/24 eth1 -j
#iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth1 - 192.168.2.88
---------------------------------------------------------------------------
squid.sh
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

service squid reload
# cat squid.sh >> /etc/squid/squid.conf