先去掉apache- yum -y remove httpd复制代码然后下载安装squid3.0- wget http://people.redhat.com/jskala/squid/squid-3.0.STABLE25-1.el5/i386/squid-3.0.STABLE25-1.el5.i386.rpm

  • rpm -i squid-3.0.STABLE25-1.el5.i386.rpm复制代码修改配置文件/etc/squid/squid.conf的内容为- acl localhost src 127.0.0.1/255.255.255.255
  • acl to_localhost dst 127.0.0.0/8
  • - http_port 80 vhost
  • - cache_peer 你的上级web服务器的ip parent 80 0 no-query originserver name=yourfirstdomain.com
  • cache_peer_domain yourfirstdomain.com .yourfirstdomain.com
  • cache_peer 你的上级web服务器的ip parent 80 0 no-query originserver name=yourotherdomain.com
  • cache_peer_domain yourotherdomain.com .yourotherdomain.com
  • - - http_access allow all
  • - cache_mem 64 MB
  • emulate_httpd_log on
  • visible_hostname buyvmvps
  • cache_mgr webmaster@example.com
  • access_log /var/log/squid/access.log squid
  • refresh_pattern . 0 20% 4320
  • acl apache rep_header Server ^Apache
  • coredump_dir /var/spool/squid复制代码设置开机启动,启动squid- chkconfig --level 2345 squid on
  • service squid start复制代码