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

Attention

Centos7默认yum安装版本为4.0.5,网上文档支持比较多;稳定版且文档较多仍集中在4.1版本

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_varnish41.repo that contains the repository configuration below.

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

[varnishcache_varnish41]
name=varnishcache_varnish41
baseurl=https://packagecloud.io/varnishcache/varnish41/el/7/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/varnishcache/varnish41/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300 [varnishcache_varnish41-source]
name=varnishcache_varnish41-source
baseurl=https://packagecloud.io/varnishcache/varnish41/el/7/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/varnishcache/varnish41/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_varnish41'

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 https://varnish-cache.org/_downloads/varnish-4.1.11.tgz

tar -xzvf varnish-4.1.11.tgz

cd varnish-4.1.11/

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

make && make install

ln -s /usr/local/varnish4/sbin/* /usr/sbin/
ln -s /usr/local/varnish4/bin/* /usr/local/bin/ cp -a /usr/local/varnish4/share/doc/varnish/example.vcl /usr/local/varnish4/default.vcl

[sleepy↓]

最新文章

  1. PHP代码的执行
  2. DbContext 和ObjectContext两者的区别
  3. Android随笔:属性
  4. 关于 Block的使用
  5. Android 弹出窗体
  6. Linux管道通信
  7. c++读取文本文件
  8. webkit框架的使用
  9. 转:Selenium借助AutoIt识别上传(下载)详解
  10. 多线程(五) java的线程锁
  11. 【BZOJ5316】[JSOI2018]绝地反击(网络流,计算几何,二分)
  12. hdu2896之AC自动机
  13. caffe实际运行中遇到的问题
  14. 在window环境下挂载mysql数据卷
  15. centos 安装elk监控
  16. 0基础的人如何入门 Python ?Python难么?
  17. error: pathspec 'master' did not match any file(s) known to git.
  18. 9.3Django
  19. Oracle jdk 历史版本官方下载地址及下载方法
  20. cocos2d-x开发: 一切应该从配置文件读取开始

热门文章

  1. 重新整理 .net core 实践篇—————配置系统之军令状[七](配置文件)
  2. 重新整理 .net core 实践篇—————配置系统之简单配置中心[十一]
  3. Mysql索引数据结构为什么是B+树?
  4. node.js学习(6)创建和删除目录
  5. THINKPHP_(2)_TP模型的多表关联查询和多表字段的关键字搜索。
  6. CVPR2020论文介绍: 3D 目标检测高效算法
  7. 标准自编码器(TensorFlow实现)
  8. JAVA面向对象详细总结
  9. 『言善信』Fiddler工具 — 13、Fiddler断点功能的使用详解
  10. 【NX二次开发】Block UI 指定方位