综合

CentOS 6.4安装配置squid

导读: 

一、环境

系统 CentOS 6.4x64最小化安装

IP 192.168.1.11

二、安装squid

下载软件包

[[email protected] ~]# wget http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE20.tar.gz

安装

[[email protected] ~]# tar xf squid-3.0.STABLE20.tar.gz 
[[email protected] ~]# cd squid-3.0.STABLE20

#设置打开最大文件数目
[[email protected] squid-3.0.STABLE20]# ulimit  -Hn 20480
[[email protected] squid-3.0.STABLE20]# echo "ulimit -Hn 20480" >>/etc/rc.local 

#设置端口范围
[[email protected] squid-3.0.STABLE20]# echo "net.ipv4.ip_local_port_range = 4000   65000" >>/etc/sysctl.conf 
[[email protected] squid-3.0.STABLE20]# sysctl -p |grep port_range
net.ipv4.ip_local_port_range = 4000   65000

[[email protected] squid-3.0.STABLE20]# ./configure  --prefix=/usr/local/squid3.0 > --enable-async-io=100 > --with-pthreads > --enable-storeio="aufs,diskd,ufs" > --enable-removal-policiles="heap,lru" > --enable-icmp > --enable-delay-pools > --enable-useragent-log > --enable-referer-log > --enable-kill-parent-hack > --enable-cachemgr-hostname=localhost > --enable-arp-acl > --enable-default-err-language=English > --enable-err-languages="Simplify_Chinese English" > --disable-pool > --disable-wccp > --disable-wccpv2 > --disable-ident-lookups > --disable-internal-dns > --enable-basic-auth-helpers="NSCA" \        #在编译的时候这个选项报错,ERROR: Basic auth helper NSCA does not exists
> --enable-stacktrace > --with-large-files > --disable-mempools > --with-filedescriptors=64000 > --enable-ssl > --enable-x-accelerator-vary > --disable-snmp > --with-aio > --enable-linux-netfilter > --enable-linux-tproxy

#注在make阶段如果报关于ssl的错误,请安装yum install openssl-devel后重新./configure
[[email protected] squid-3.0.STABLE20]# make
[[email protected] squid-3.0.STABLE20]# make install
[[email protected] squid-3.0.STABLE20]# ln -s /usr/local/squid3.0/ /usr/local/squid
[[email protected] squid-3.0.STABLE20]# ll /usr/local/ |grep squid
lrwxrwxrwx  1 root root   20 Jul 19 22:09 squid -> /usr/local/squid3.0/
drwxr-xr-x  8 root root 4096 Jul 19 22:06 squid3.0


本文出自 “ly36843运维” 博客,请务必保留此出处http://ly36843.blog.51cto.com/3120113/1676190

相关资讯

发表评论
网友评论0 条评论)
暂无评论