红联Linux门户
Linux帮助

SQUID代理服务器的安装

发布时间:2017-06-14 11:50:23来源:红联作者:lzx1823
本次安装环境:
[root@proxy6 ~]# uname -a
Linux proxy6.cgmh.com.cn 2.6.32-696.el6.i686 #1 SMP Tue Mar 21 18:53:30 UTC 2017 i686 i686 i386 GNU/Linux
[root@proxy6 ~]# lsb_release -a
LSB Version: :base-4.0-ia32:base-4.0-noarch:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.9 (Final)
Release: 6.9
Codename: Final

安装步骤:
1、确认并安装squid。
rpm -aq | grep squid
yum -y install squid
2、设置开机启动。
chkconfig squid on
3、修改配置。
cd /etc/squid/
vi squid.conf:
http_port 8080
cache_swap_low 80
cache_swap_high 85
maximum_object_size 4 MB
minimum_object_size 8 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
fqdncache_size 1024
cache_replacement_policy lru
memory_replacement_policy lru
cache_dir ufs /var/spool/squid 7500 16 256
access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
logfile_rotate 7 #由90修改为7
request_header_access Via deny all
request_header_access X-Forwarded-For deny all
auth_param basic casesensitive off
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
http_access allow all
4、初始化
squid -z #服务已启动出错
service squid stop
squid -z
service squid start
5、关闭防火墙。
service iptables status
service iptables stop
chkconfig iptables off

文章评论

共有 0 条评论