tail -f /var/log/syslog
–
May 1 14:45:11 server varnishd[1662]: Child start failed: could not open sockets May 1 14:45:17 server varnishd[1688]: Child start failed: could not open sockets
–
漆:
root@server:~# varnishd -V varnishd (varnish-2.1.4 SVN ) Copyright (c) 2006-2009 Linpro AS / Verdens Gang AS
–
/ etc / default / varnish中的更改
# Should we start varnishd at boot? Set to "yes" to enable. START=yes
– 更改了默认端口号:
DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G"
default.vcl中的更改
backend default { .host = "127.0.0.1"; .port = "8080"; .connect_timeout = 600s; .first_byte_timeout = 600s; .between_bytes_timeout = 600s; .max_connections = 800;
开始清漆给我这个:
root@server:~# service varnish restart * Stopping HTTP accelerator varnishd [fail] * Starting HTTP accelerator varnishd [ OK ]
服务器运行nginx,php5-fpm,apc,memchache,varnish,mysql,wordpress。
可能是什么问题呢? 谢谢你的帮助。
root@server:~# sudo netstat -tlnp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 2009/nginx tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2009/nginx tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1271/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1408/sendmail: MTA: tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 1300/main.conf) tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1239/mysqld tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 1408/sendmail: MTA: tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 1204/memcached tcp6 0 0 :::80 :::* LISTEN 2009/nginx tcp6 0 0 :::22 :::* LISTEN 1271/sshd
你已经有nginx监听端口80,你已经告诉Varnish监听端口80.只有其中一个可以为任何IP address:port组合做这个。
既然你的nginx 也在端口8080上侦听,并且你已经configurationVarnish来使用端口8080作为后端,你可能会想停止nginx监听端口80。