1、使用yum安装varnish
1.1、安装varnish
//安装epel源 yum install epel-release.noarch //安装varnish yum install varnish //启动服务 systemctl start varnish.service
1.2、varnish的程序环境
]# rpm -ql varnish /etc/varnish/varnish.params #配置varnish服务进程的属性,例如监听的地址和端口、缓存机制等。 /etc/varnish/default.vcl #配置各Child/Cache线程的缓存策略 /usr/sbin/varnishd #varnish的主程序 /usr/sbin/varnish_reload_vcl #VCL配置文件重载工具 /usr/bin/varnishadm #varnish的命令行管理工具 /usr/bin/varnishlog #启动该服务,可以持久化varnish的日志 /usr/bin/varnishncsa #启动该服务,可以持久化varnish的日志 /usr/bin/varnishhist /usr/bin/varnishstat /usr/bin/varnishtop /usr/bin/varnishtest #varnish的测试工具 /usr/lib/systemd/system/varnish.service /usr/lib/systemd/system/varnishlog.service /usr/lib/systemd/system/varnishncsa.service /var/log/varnish ...
1
2、编译安装varnish
1、下载varnish安装包
- https://varnish-cache.org/releases/
2、安装依赖
]# yum install autoconf automake jemalloc-devel libedit-devel libtool ncurses-devel pcre-devel pkgconfig python-docutils python-sphinx graphviz
3、编译安装
//解压文件 ]# gunzip varnish-4.0.5.tgz ]# tar fx varnish-4.0.5.tar //编译安装 ]# cd varnish-4.0.5/ ]# ./autogen.sh ]# ./configure --prefix=/apps/varnish/ ]# make && make install ]# ldconfig
4、配置文件
]# cp etc/example.vcl /apps/varnish/default.vcl
5、启动服务
]# varnishd -f /apps/varnish/default.vcl -s malloc,200M -a 0.0.0.0:80 -T 127.0.0.1:8081
1
# #标签:bin,varnish,varnish02,vcl,devel,usr,安装 From: https://www.cnblogs.com/maiblogs/p/16990514.html