基础结构:
0 1 2 3 |
内核版本:Linux squid 2.6.32-358.el6.x86_64 [CentOS release 6.4] 安装目录:/usr/local/varnish [ln -s /byrd/service/varnish-4.1.2 /usr/local/varnish] Varnish服务器:1.1.1.21 web服务器(apache):1.1.1.11 web服务器(nginx):1.1.1.12 [root@Varnish varnish-4.1.2]# ./configure --prefix=/byrd/service/varnish-4.1.2 #参数中多少默认激活,因此不编译 |
必装组件
0 |
yum install python-docutils pcre-devel ncurses-devel pcre-devel libedit-devel -y |
yum安装:
0 1 2 3 |
yum install epel-release wget https://repo.varnish-cache.org/redhat/varnish-4.1.el6.rpm rpm -Uvh varnish-4.1.el6.rpm yum install varnish |
配置文件:
0 1 2 3 4 5 6 |
[root@squid vcache]# cat /usr/local/varnish/etc/vcl.conf vcl 4.0; #4.0 Version statement import std; #2.x update3.x import directors; #3.x update 4.x backend server1 { # Define one backend .host = "127.0.0.1"; # IP or Hostname of backend .port = "80"; # Port Apache or whatever is listening |
服务启动:
0 1 |
/usr/local/varnish/sbin/varnishd -f /usr/local/varnish/etc/vcl.conf -s malloc,1G -T 127.0.0.1:2100 -a 0.0.0.0:80 1:主程序,VCL script, -s malloc{基于内存}[,<size>],Telnet listen address and port,HTTP listen address and port |
帮助文档:
0:http://book.varnish-software.com/4.0/
1:https://www.varnish-cache.org/trac/wiki/VCLExamples
2:http://linuxguest.blog.51cto.com/195664/354889/
3:https://github.com/comotion/security.vcl
4:http://sofar.blog.51cto.com/353572/1653683
5:https://www.varnish-cache.org/docs/4.0/reference/vcl.html#reference-vcl-probesSourceByrd's Weblog-https://note.t4x.org/system/varnish-cache-config/
SourceByrd's Weblog-https://note.t4x.org/system/varnish-cache-config/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!