varnish02-安装varnish
1、使用yum安装varnish
- https://varnish-cache.org/
- https://github.com/varnishcache/varnish-cache
- https://github.com/varnish/varnish-modules
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-4.0.5/ ]# make && make install ]# ldconfig
4、配置文件
]# cp etc/example.vcl /apps/varnish-4.0.5/default.vcl
5、启动服务
]# varnishd -f /apps/varnish-4.0.5/default.vcl -s malloc,200M -a 0.0.0.0:80 -T 127.0.0.1:8081
1
# #