SQUID代理服务器的安装(AIIP全国技能大赛企业联合教程)

SQUID代理服务器,是为了防止网络带宽堵塞,增加访问速度的一个代理服务,这将大大提升了网络带宽的利用,使访问变快,也将同时减少了网络的负担。今天我们就对如何安装SQUID代理服务器,和相关的简单配置。(该项目属于2019年全国职业技能大赛官方委员会赛题的核心技术之一)

安装必要环境

 [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: (使用VI来编辑文件)
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 90 # ( 将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

声明:原博客 我不是猫叔 ,帐号已被本人注销 ,本博客文章属于原帐号博客,属于本人原创 。

发布了70 篇原创文章 · 获赞 10 · 访问量 3223

猜你喜欢

转载自blog.csdn.net/JN_Cat/article/details/102459089