Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
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

-

Varnish:

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.
START=yes

- 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 = "127.0.0.1";
    .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 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
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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.