varnish用80埠
阿新 • • 發佈:2019-01-04
1.先修改apache的監聽埠
/usr/sbin/varnishd -P /var/run/varnish.pid -a :80 -f /etc/varnish/default.vcl -T 127.0.0.1:6082 -t 120 -w 1,1000,120 -u varnish -g varnish -S /etc/varnish/secret -s file,/var/lib/varnish/varnish_storage.bin,1G
預設啟動二個程序,從ps -aux|grep varnish中看,引數都是一樣的
4.測試
http://192.168.1.201
5.varnish的命令常用的有
varnishd
varnish_reload_vcl
varnishlog
varnishstat
其它還有:
varnishadm
varnishhist
varnishncsa
varnishreplay
varnishsizes
varnishtest
varnishtop
請檢視它的幫助文件:
命令 --help
在/etc/httpd/conf/httpd.conf中修改Listen 8080
2.修改varnish的配置
在default.vcl中修改如下程式碼:
backend default {
.host = "127.0.0.1";
.port = "8080";
}
/usr/sbin/varnishd -P /var/run/varnish.pid -a :80 -f /etc/varnish/default.vcl -T 127.0.0.1:6082 -t 120 -w 1,1000,120 -u varnish -g varnish -S /etc/varnish/secret -s file,/var/lib/varnish/varnish_storage.bin,1G
預設啟動二個程序,從ps -aux|grep varnish中看,引數都是一樣的
4.測試
http://192.168.1.201
5.varnish的命令常用的有
varnishd
varnish_reload_vcl
varnishlog
varnishstat
其它還有:
varnishadm
varnishhist
varnishncsa
varnishreplay
varnishsizes
varnishtest
varnishtop
請檢視它的幫助文件:
命令 --help