varnish6.X安装


本文提供了两种安装方式,但建议使用编译安装

Attention
Centos7默认yum安装版本为4.0.5,网上文档支持比较多;最新版本为6.3.0,较4.x老版本变化较大,需要参照官方文档进行学习

1. rpm方式

Install pygpgme, a package which allows yum to handle gpg signatures, and a package called yum-utils which contains the tools you need for installing source RPMs.

sudo yum install pygpgme yum-utils

You may need to install the EPEL repository for your system to install these packages. If you do not install pygpgme, GPG verification will not work.

Create a file named /etc/yum.repos.d/varnishcache_varnish60lts.repo that contains the repository configuration below.

Make sure to replace el and 6 in the config below with your Linux distribution and version:

[varnishcache_varnish60lts]
name=varnishcache_varnish60lts
baseurl=https://packagecloud.io/varnishcache/varnish60lts/el/6/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/varnishcache/varnish60lts/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[varnishcache_varnish60lts-source]
name=varnishcache_varnish60lts-source
baseurl=https://packagecloud.io/varnishcache/varnish60lts/el/6/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/varnishcache/varnish60lts/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

Valid options for os and dist parameters can be found in our supported OS list in the docs.

Update your local yum cache by running

sudo yum -q makecache -y --disablerepo='*' --enablerepo='varnishcache_varnish60lts'

You can now install packages from your repository.

yum install varnish

The configuration file is /etc/varnish/default.vcl

2. 编译安装

2.1 依赖包

#yum install -y libtool ncurses-devel pcre-devel libxslt libedit python-imaging python-docutils

yum install -y pcre-devel python-docutils libedit-dev* 

2.2 编译Varnish

wget http://varnish-cache.org/_downloads/varnish-6.3.0.tgz

tar -xzvf varnish-6.3.0.tgz

cd varnish-6.3.0/

./configure --prefix=/usr/local/varnish6

make && make install

ln -s /usr/local/varnish6/sbin/* /usr/sbin/
ln -s /usr/local/varnish6/bin/* /usr/local/bin/

cp -a /usr/local/varnish6/share/doc/varnish/example.vcl /usr/local/varnish6/default.vcl

 
[sleepy↓]


 
 

转载于:https://www.cnblogs.com/sunhongleibibi/p/11613181.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值