varnish安装

系统环境CentOS7.3

第一种方法最简单:yum安装

本身使用的base源并没有varnish的yum包,但是

EPEL源上是有的,如果想YUM安装的话直接切换成EPEL源即可

wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

rpm -ivh epel-release-latest-7.noarch.rpm

yum install varnish

 

第二种方式源码编译

这里主要记录一下varnish源码编译安装时候缺少的各种包及相关报错信息。

需要在安装varnish之前,安装的各种包

  • autoconf
  • automake
  • jemalloc-devel
  • libedit-devel
  • libtool
  • ncurses-devel
  • pcre-devel
  • pkgconfig
  • python-docutils
  • python-sphinx
  • graphviz

缺少python-docutils

checking for rst2man... no
checking for rst2man.py... no
configure: error: rst2man is needed to build Varnish, please install python-docutils.

缺少ncurses-devel

checking for NcursesW wide-character library... no
checking for Ncurses library... no
checking for Curses library... no
configure: error: requires an X/Open-compatible Curses library

缺少libedit-devel

checking edit/readline/readline.h usability... no
checking edit/readline/readline.h presence... no
checking for edit/readline/readline.h... no
checking for LIBEDIT... no
checking for a readline compatible library... no
configure: error: neither libedit nor another readline compatible library found

yum inistall python-docutils ncurses-devel libedit-devel

 ./configure --prefix=/var/varnish/

make && make install

编译安装完毕后程序所在位置:

/var/varnish/sbin/varnishd

/var/varnish/bin/

varnishadm  varnishhist  varnishlog  varnishncsa  varnishstat  varnishtest  varnishtop

如果在configure的时候不配置路径的话默认会安装在:

/usr/local

/usr/local/sbin/varnishd

/usr/local/bin/

配置文件位置:

需要自己cp一个初始文件或者自己创建一个

mkdir /etc/varnish/ && cp ./etc/example.vcl /etc/varnish/default.vcl

注:这个配置文件里默认定义的后端服务器

    backend default {
       .host = "127.0.0.1";
       .port = "8111";
     }

最后执行:

varnishd  -f /etc/varnish/default.vcl -a :6081 -T localhost:6082

就可以工作了。当然还有很多参数并没有设定。

转载于:https://www.cnblogs.com/colinshi/p/8990938.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值