Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
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


Changes in /etc/default/varnish

# Should we start varnishd at boot?  Set to "yes" to enable.

- Changed default port number:

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"

Changes in default.vcl

backend default {
    .host = "";
    .port = "8080";
    .connect_timeout = 600s;
    .first_byte_timeout = 600s;
    .between_bytes_timeout = 600s;
    .max_connections = 800;

Start varnish gives me this:

root@server:~# service varnish restart
 * Stopping HTTP accelerator varnishd                                    [fail]
 * Starting HTTP accelerator varnishd                                    [ OK ]

Server running nginx , php5-fpm, apc, memchache, varnish, mysql, wordpress.

What could be the problem? Thanks for any help.

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  *               LISTEN      2009/nginx
tcp        0      0    *               LISTEN      2009/nginx
tcp        0      0    *               LISTEN      1271/sshd
tcp        0      0  *               LISTEN      1408/sendmail: MTA:
tcp        0      0*               LISTEN      1300/main.conf)
tcp        0      0*               LISTEN      1239/mysqld
tcp        0      0 *               LISTEN      1408/sendmail: MTA:
tcp        0      0*               LISTEN      1204/memcached
tcp6       0      0 :::80                   :::*                    LISTEN      2009/nginx
tcp6       0      0 :::22                   :::*                    LISTEN      1271/sshd
share|improve this question
Could you add the output of sudo netstat -tlnp to your question? – Ladadadada May 1 '12 at 11:36
added netstat info. – bran May 1 '12 at 11:48
up vote 3 down vote accepted

You already have nginx listening on port 80 and you have told Varnish to listen on port 80. Only one of them can do this for any IP address:port combination.

Since you have nginx also listening on port 8080 and you have configured Varnish to use port 8080 as the backend, you will probably want to stop nginx listening on port 80 at all.

share|improve this answer
Thanks. That seems to be the case I don't have access to the server now, but I think it should be an easy fix. – bran May 1 '12 at 15:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.