步骤:https://www.varnish-cache.org/docs/3.0/tutorial/putting_varnish_on_port_80.html
这是我的一步:
1) pkill varnishd (完成!)
2)修改web服务器的配置,使其绑定到端口8080,而不是80“
这一步是什么意思?我用Apache
3) default.vcl并将默认后端的端口更改为8080 (完成!)
4) varnishd -f /usr/local/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 (完成!)
清漆不起作用,因为我跳过了第三步。我在那里要做什么?解释一个步骤..。
PS:有什么比清漆更简单的选择呢?
发布于 2012-02-11 00:55:52
由于您需要更改端口,所以我假设Varnish和Apache都是从同一台机器上提供的。标准的www端口是80。您希望Varnish为该端口提供服务,并将请求转发给在另一个端口上运行的Apache (8080)。
我不经常配置Apache的端口,但我认为下面的描述应该有效。编辑httpd.conf文件(通常在“/etc/httpd/conf/httpd.conf”中找到)并将端口设置从“端口80”更改为“端口8080",然后重新启动apache。如果存在“聆听8080”,您也必须将其更改为“侦听8080”。
发布于 2012-02-12 07:02:47
如果您正在使用Debian,下面是说明:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/varnish stop
sudo /etc/init.d/varnish stop
/etc/apache2/ports.conf将Listen 80更改为Listen 8080
/etc/apache2/sites-available/* change <VirtualHost xxxxxxxxxxx:80>中更改为<VirtualHost xxxxxxx*:8080>
/etc/default/varnish,更改以下代码:malloc,256m" DAEMON_OPTS="-a :6081 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/-T\ -s -a
如下所示
DAEMON_OPTS="-a :8080 \ <======== THIS LINE
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,256m"在/etc/varnish/default.vcl中,用以下代码声明后端:
backend default {
.host = "127.0.0.1";
.port = "8080";
}sudo /etc/init.d/apache2 start
sudo /etc/init.d/varnish starthttps://stackoverflow.com/questions/9236482
复制相似问题