如何安装 Squid(缓存/代理) Fedora 20

注意:请注意,本文被视为遗留文档,因为 Fedora 20 已达到其生命周期结束的支持。

Squid 是一个缓存和转发网络代理。 它最常与传统的 LAMP 堆栈(Linux、 Apache、MySQL、PHP),并可用于过滤 HTTP、FTP 和 HTTPS 上的流量,并通过缓存提高 Web 服务器的速度(从而降低响应时间)。

飞行前检查

  • 这些说明专门用于在单机上安装 Squid Fedora 20 个节点。
  • 我将从 Liquid Web Self Managed 工作 Fedora 20服务器,我将以root身份登录。

步骤 #1 安装 Squid

一、清理yum:

yum clean all

作为最佳实践,我们将更新我们的包:

yum -y update

安装 Squid 和相关软件包现在就像只运行一个命令一样简单:

yum -y install squid

步骤#2:验证和检查 Squid 安装的版本

Squid 应在安装后立即启动。 使用以下命令查看命令信息:

squid -h

使用以下命令检查 Squid 的版本号和启动它的配置选项:

squid -v

您的结果应类似于:

鱿鱼缓存:版本 3.3.8
配置选项: ‘–build=x86_64-redhat-linux-gnu’ ‘–host=x86_64-redhat-linu x-gnu’ ‘–program-prefix=’ ‘–prefix=/usr’ ‘–exec-prefix=/usr ‘ ‘–bindir=/usr/b in’ ‘–sbindir=/usr/sbin’ ‘–sysconfdir=/etc’ ‘–datadir=/usr/share’ ‘–included ir=/usr/include’ ‘–libdir= /usr/lib64’ ‘–libexecdir=/usr/libexec’ ‘–sharedstat edir=/var/lib’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–disable-严格错误检查’ ‘–exec_prefix=/usr’ ‘–libexecdir=/usr/lib64/squid’ ‘–l ocalstatedir=/var’ ‘–datadir=/usr/share/squid’ ‘–sysconfdir=/etc/ squid’ ‘–wit h-logdir=$(localstatedir)/log/squid’ ‘–with-pidfile=$(localstatedir)/run/squid. pid’ ‘–disable-dependency-tracking’ ‘–enable-eui’ ‘–enable-follow-x-forwarded -for’ ‘–enable-auth’ ‘–enable-auth-basic=DB,LDAP,MSNT,MSNT-多域,NCSA,N IS,PAM,POP3,RADIUS,SASL,SMB,getpwnam”–enable-auth-ntlm=smb_lm,fake”’–enable -auth-digest=file,LDAP,eDirectory”–启用-auth-negotiate=kerberos”–enable-external-acl-helpers=ip_user,ldap_group,time_quota,session,unix_group,wbinfo_group”–enable-cache-digests”–enable-cachemgr-hostname=localhost”- enable-delay-pools”–enable-epoll”–enable-icap-client”–enable-ident-lookups”–enable-linux-netfilter”–enable-removal-policies=heap,lru’ ‘–enable-snmp’ ‘–enable-ssl’ ‘–enable-ssl-crtd’ ‘–enable-storeio=aufs,diskd,ufs’ ‘–enable-wccpv 2’ ‘–enable-esi’ ‘–enable- ecap’ ‘–with-aio’ ‘–with-default-user=squid’ ‘–with-filedescriptors=16384’ ‘–with-dl’ ‘–with-openssl’ ‘–with-pthreads’ ‘build_ alias=x86_64 -redhat-linux-gnu’ ‘host_alias=x86_64-redhat-linux-gnu’ ‘CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack -protector-strong –p aram=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fpie’ ‘LDFLAG S=-Wl,-z,relro -pie -Wl,-z,relro -Wl,-z,now’ ‘CXXFLAGS=-O2 -g -pipe -Wall -Wp,- D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong –param=ssp-buffer-size =4 -grecord-gcc-switches -m64 -mtune=generic -fpie’ ‘PKG_CONFIG_PATH=%{_PKG_CON FIG_PATH}:/usr/lib64/pkgconfig:/usr/share/pkgconfig’

第 3 步:将 Squid 配置为在引导时启动

然后启动 Squid:

systemctl start squid

确保 Squid 在引导时启动:

systemctl enable squid

检查 Squid 的状态:

systemctl status squid

停止鱿鱼:

systemctl stop squid