1,下载安装包
curl -O http://www.squid-cache.org/Versions/v3/3.4/squid-3.4.13.tar.gz
2,解压安装包
tar -xvf squid-3.4.13.tar.gz
3,编译squid
cd squid-3.4.13/
./configure --prefix=/var/local/squid-3.4/squid --disable-hostname-checks --enable-underscore --enable-snmp --with-maxfd=65535 --enable-storeio=ufs,diskd --enable-follow-x-forwarded-for --enable-gnuregex --enable-async-io=320 --enable-epoll --enable-default-err-language=Simplify_Chinese --enable-storeio=aufs,diskd,ufs --enable-cahce-digests --enable-kill-parent-hack --enable-default-err-languages="Simplify_Chinese"
4,安装
make && make install
5,创建相关目录
mkdir -p /home/squid
mkdir -p /home/squid/cache1
mkdir -p /home/squid/cache2
6,创建squid用户和组
groupadd squid
useradd squid -g squid -p squid -d /home/squid
7,初始化空间
./squid -z
8,检查配置是否正确
./squid -k parse
9,启动squid
./squid -N -d1
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/joeyon/squid-3.4.13':
configure: error: no acceptable C compiler found in $PATH
原因:确实c和c++编译器,安装
yum install gcc-c++
2,清除指定url的缓存:
squidclient -m PURGE -p 5006 "http://xxx.xxx.xxx.xxx:8080/pics/5575eebfa3100bee21d5f0a1"
3,执行分片空间前,需要在squid.conf配置相关缓存信息