2

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).

Astaar
  • 448
  • 1
  • 8
  • 18

3 Answers3

5

Test config:

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

Run foreground(for debug):

/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -D
alvosu
  • 8,437
  • 25
  • 22
  • 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: – Astaar Feb 07 '11 at 10:24
  • 1
    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 07 '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) – Astaar Feb 07 '11 at 11:48
  • Change owner to www-data or permission to 666 – alvosu Feb 07 '11 at 11:57
  • Owning is setup to be :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. – Astaar Feb 07 '11 at 12:07
2

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

Lucas Kauffman
  • 16,880
  • 9
  • 58
  • 93
oroel
  • 21
  • 1
0

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

Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
  • Wouldn't Lighttpd report an error if that was the case? What do you mean by "check the logging directives" ? – Astaar Feb 07 '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 07 '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. – Astaar Feb 07 '11 at 11:21