<b>Ubuntu下的Squid缓存服务器搭建初体验</b>[服务器安全]
本文“<b>Ubuntu下的Squid缓存服务器搭建初体验</b>[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
Ubuntu-maverick-10.10-amd64-server
*挑选Ubuntu系统是因为安装软件便利快速
卸载squid
sudo apt-get purge remove squid
安装squid
sudo aptitude install squid
cd /etc/squid
|
sudo mv squid.conf squid_bak.conf
sudo vi squid.conf
随便谷歌了个网站测试,代码段:
http_port 80 vhost
cache_dir ufs /var/squid_cache 256 16 256
acl all src 0.0.0.0/0.0.0.0
http_access allow all
#cache_access_log /var/log/squid/access.log
#cache_log /var/log/squid/cache.log
cache_peer 67.18.180.141 parent 80 0 no-query originserver weight=1 name=hc_peer
cache_peer_domain hc_peer www.linuxidc.com
cache_peer_access hc_peer allow all
refresh_pattern -i \.css$ 1440 50% 129600 ignore-reload
refresh_pattern -i \.xml$ 1440 50% 129600 ignore-reload
refresh_pattern -i \.html$ 1440 90% 129600 reload-into-ims
refresh_pattern -i \.shtml$ 1440 90% 129600 reload-into-ims
refresh_pattern -i \.htm$ 1440 90% 129600 reload-into-ims
refresh_pattern -i \.jpg$ 1440 90% 129600 reload-into-ims
refresh_pattern -i \.png$ 1440 90% 129600 reload-into-ims
refresh_pattern -i \.gif$ 1440 90% 129600 ignore-reload
refresh_pattern -i \.bmp$ 1440 90% 129600 reload-into-ims
refresh_pattern -i \.js$ 1440 90% 129600 ignore-reload
ESC -》:wq
当时碰到一个问题,没用sudo号令,后果招致改正的东西保存不了,也不知道怎么退出.后来才理解可以利用shift+q,然后输入:q!强退.
重启squid:
sudo /usr/sbin/squid -k parse
sudo /usr/sbin/squid -k reconfigure
*每次改正了squid.conf都需求重启squid才能见效的
/usr/sbin/squid -z
/usr/sbin/squid start
查看网络衔接:
netstat -an
查看80端口占用:
sudo lsof -i:80
本文地址: | 与您的QQ/BBS好友分享! |