varnish用80端口

1.先修改apache的监听端口

在/etc/httpd/conf/httpd.conf中修改Listen 8080

2.修改varnish的配置

在default.vcl中修改如下代码:

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

3.用命令启动varnish
 /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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值