I recently installed Lighttpd on Ubuntu Server 10.04 x86_64 and created several websites. What I do is include /etc/lighttpd/vhost.d/*.conf and put a configuration file for each website in that directory.

The problem I have is when I "service lighttpd start" I get the message that the service started, there is no error message:

root@178-33-104-210:~# service lighttpd start 
Syntax OK  
* Starting web server lighttpd                   [ OK ]

But then if I take a look at the services listening, Lighttpd is nowhere to be seen:

root@178-33-104-210:~# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 localhost:mysql         *:*                     LISTEN      829/mysqld
tcp        0      0 *:ftp                   *:*                     LISTEN      737/vsftpd
tcp        0      0 *:ssh                   *:*                     LISTEN      739/sshd
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      739/sshd

So I'm looking at ways I could troubleshoot this. I checked in /var/log/lighttpd/error.log and there's nothing in it.

Edit: Sorry, I indicated I use CentOS but it's actually Ubuntu Server (I usually use CentOS but had to go with Ubuntu for that one).

link|improve this question
feedback

3 Answers

up vote 1 down vote accepted

Test config:

/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -t

Run foreground(for debug):

/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -D
link|improve this answer
The test config returns that all is fine. Running in the foreground doesn't change much as the program seems to just be not running: – Furism Feb 7 '11 at 10:24
what "ps aux | grep lighttpd"? Try reinstall lighttpd. Also attach strace "strace -f /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -D 2>~/strace" – alvosu Feb 7 '11 at 10:28
Ok looking at the strace there seems to be a permission problem on one of the vhosts (wiki), although the chmod and ownership of the files seem to be correctly set (and identical to another one that works, "mysql"): fcntl(8, F_SETFD, FD_CLOEXEC) = 0 open("/home/mysql/logs/access.log", O_WRONLY|O_CREAT|O_APPEND, 0644) = 9 fcntl(9, F_SETFD, FD_CLOEXEC) = 0 open("/home/wiki/logs/access.log", O_WRONLY|O_CREAT|O_APPEND, 0644) = -1 EACCES (Permission denied) – Furism Feb 7 '11 at 11:48
Change owner to www-data or permission to 666 – alvosu Feb 7 '11 at 11:57
Owning is setup to be <userdir>:www-data. This looks identical on the working part (mysql) and non-working (wiki), but I'll look into it more because obviously something is wrong. Thanks a lot of the help, I wouldn't have made it on lighttpd's feedback only. – Furism Feb 7 '11 at 12:07
feedback

Perhaps lighttpd tries to log to some location where it does not have write access? Check the logging directives.

link|improve this answer
Wouldn't Lighttpd report an error if that was the case? What do you mean by "check the logging directives" ? – Furism Feb 7 '11 at 10:27
I meant that perhaps one of those configuration files under /etc/lighttpd/vhost.d has something like accesslog.filename="/some/not_writable/path" and that makes lighttpd to die. Has your configuration worked before? What did you do to make it not work? :) – Janne Pikkarainen Feb 7 '11 at 10:43
I had errors of that kind before, but commented them out and it still doesn't work. I reverted to the last known configuration (two vhosts were working) by renaming the other to xxx.conf.old, no luck. – Furism Feb 7 '11 at 11:21
feedback

Did you disable

server.use-ipv6 = "enable"

in your .conf? I ran into the same problem and found with

$ netstat -ntulp

that the server was listening on ipv6. After disabling server.use-ipv6 I was able to connect to lighttp via ipv4. There is also an old bug report on this issue, where they say that it is a BSD specific problem. I am using Ubuntu.

http://redmine.lighttpd.net/issues/509

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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