Squid2.6反向代理实现多个Web缓存加速--Config More Web Cache Acceleration with Squid Transparent Proxy[安装文档]
Squid反向代理实现Web缓存加速
--Config Web Cache Acceleration with Squid Transparent Proxy
Step I - Downloading and compiling Squid
wget http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE3-20060823.tar.gz
[root@localhost software]# tar zxvf squid-2.6.STABLE3-20060823.tar.gz
[root@localhost software]# cd squid-2.6.STABLE3-20060823
[root@localhost squid-2.6.STABLE3-20060823]# vi config.sh
写入内容如下:
| 代码: |
| #!/bin/bash SQUID_ROOT="/Data/apps/squid" ./configure --prefix=$SQUID_ROOT \ --enable-useragent-log \ --enable-referer-log \ --enable-default-err-language=Simplify_Chinese \ --enable-err-languages="Simplify_Chinese English" \ --disable-internal-dns \ --enable-dlmalloc \ --with-pthreads \ --enable-poll \ --enable-stacktrace \ --enable-removal-policies="heap,lru" \ --enable-delay-pools \ --enable-storeio="aufs,coss,diskd,ufs" |
[root@localhost squid-2.6.STABLE3-20060823]# sh config.sh
[root@localhost squid-2.6.STABLE3-20060823]# make
[root@localhost squid-2.6.STABLE3-20060823]# make install
Step II - Basic Configuration
[root@localhost squid-2.6.STABLE3-20060823]# cd /Data/apps/squid/
[root@localhost squid-2.6.STABLE3-20060823]# mkdir cache
[root@localhost squid-2.6.STABLE3-20060823]# chown squid.squid *
在/etc/hosts中:加入内部的DNS解析,比如:
211.100.99.100 longrujun.name
211.100.100.101 blog.hanlei.name
61.135.100.100 www.liuren.com
60.195.200.159 www.keso.cn
B、vi /Data/apps/squid/etc/squid.conf
squid.conf
Step III - Starting Squid
A、创建缓存目录
[root@redhatas4 sbin]# ./squid –z
B、测试Squid运行状况
[root@redhatas4 sbin]# ./squid –NCd1
成功后将出现"Ready to serve requests".否则请检查配置文件
C、
启动Squid
/Data/apps/squid/sbin/squid
停止 Squid
/Data/apps/squid/sbin/squid –k shutdown
启用新配置:
/Data/apps/squid/sbin/squid -k reconfig
通过crontab每天0点截断/轮循日志:
0 0 * * * (/Data/apps/squid/sbin/squid -k rotate)
Published 2006年8月25日 9:29 by
admin Filed under: SQUID, How to, CacheTrackback: http://tb.donews.net/TrackBack.aspx?PostId=1016032