You are not logged in.

#1 2008-02-11 14:34:00

Zyx
Member
From: Poland
Registered: 2006-12-09
Posts: 20
Website

Lighttpd + simple vhosts don't work at all.

I'm trying to configure Lighttpd with simple vhosts on my computer for a couple of hours. However, the servers seems to completely ignore "mod_simple_vhosts" and all its settings without any reason. This is my configuration:

server.modules = ("mod_access", "mod_simple_vhost")
server.document-root = "/home/lighttpd/www"

simple-vhost.server-root   = "/home/lighttpd/vhosts/Sites"
simple-vhost.default-host  = "sites.sites.lh"
simple-vhost.document-root = "/"

No matter, what I set in the three last directives and no matter, what subdomain I use in the browser, it always shows me the content of /home/lighttpd/www directory. I turned on the debug log. Here is a sample request to the subdomain:

2008-02-11 15:07:53: (response.c.205) -- splitting Request-URI 
2008-02-11 15:07:53: (response.c.206) Request-URI  :  / 
2008-02-11 15:07:53: (response.c.207) URI-scheme   :  http 
2008-02-11 15:07:53: (response.c.208) URI-authority:  sites.sites.lh 
2008-02-11 15:07:53: (response.c.209) URI-path     :  / 
2008-02-11 15:07:53: (response.c.210) URI-query    :   
2008-02-11 15:07:53: (response.c.260) -- sanatising URI 
2008-02-11 15:07:53: (response.c.261) URI-path     :  / 
2008-02-11 15:07:53: (mod_access.c.135) -- mod_access_uri_handler called 
2008-02-11 15:07:53: (response.c.375) -- before doc_root 
2008-02-11 15:07:53: (response.c.376) Doc-Root     : /home/lighttpd/www/ 
2008-02-11 15:07:53: (response.c.377) Rel-Path     : / 
2008-02-11 15:07:53: (response.c.378) Path         :  
2008-02-11 15:07:53: (response.c.426) -- after doc_root 
2008-02-11 15:07:53: (response.c.427) Doc-Root     : /home/lighttpd/www/ 
2008-02-11 15:07:53: (response.c.428) Rel-Path     : / 
2008-02-11 15:07:53: (response.c.429) Path         : /home/lighttpd/www/ 
2008-02-11 15:07:53: (response.c.446) -- logical -> physical 
2008-02-11 15:07:53: (response.c.447) Doc-Root     : /home/lighttpd/www/ 
2008-02-11 15:07:53: (response.c.448) Rel-Path     : / 
2008-02-11 15:07:53: (response.c.449) Path         : /home/lighttpd/www/ 
2008-02-11 15:07:53: (response.c.466) -- handling physical path 
2008-02-11 15:07:53: (response.c.467) Path         : /home/lighttpd/www/ 
2008-02-11 15:07:53: (response.c.474) -- file found 
2008-02-11 15:07:53: (response.c.475) Path         : /home/lighttpd/www/ 
2008-02-11 15:07:53: (response.c.613) -- handling subrequest 
2008-02-11 15:07:53: (response.c.614) Path         : /home/lighttpd/www/ 
2008-02-11 15:07:53: (mod_indexfile.c.149) -- handling the request as Indexfile 
2008-02-11 15:07:53: (mod_indexfile.c.150) URI          : / 
2008-02-11 15:07:53: (mod_access.c.135) -- mod_access_uri_handler called 
2008-02-11 15:07:53: (mod_staticfile.c.394) -- handling file as static file 
2008-02-11 15:07:53: (response.c.625) -- subrequest finished 
2008-02-11 15:07:53: (response.c.114) Response-Header: 
HTTP/1.1 200 OK
Content-Type: text/html
Accept-Ranges: bytes
ETag: "292166558"
Last-Modified: Mon, 10 Sep 2007 14:26:27 GMT
Content-Length: 303
Date: Mon, 11 Feb 2008 14:07:53 GMT
Server: lighttpd

It shows that Lighttpd does not even look at virtual hosts. The server has all the required permissions and several various configurations were tested. Server status shows that the necessary module is loaded. Has anyone encountered a similar problem and may give me some clue, how to solve it?

Last edited by Zyx (2008-02-11 14:34:30)

Offline

#2 2008-02-14 03:26:36

xPlozion
Member
From: Newark, DE, USA
Registered: 2007-03-16
Posts: 16
Website

Re: Lighttpd + simple vhosts don't work at all.

I don't know how helpful this can be, but vhosts can be setup differently. you don't even need mod_simple_vhosts enabled.

$HTTP["host"] =~ "subdomain\.domain\.com" {
        server.document-root = "/home/lighttpd/vhosts/subdomain.domain.com/public_html/"
}

obviously, you can change the doc root and the host.  I place that under server.document-root for easy access

Offline

#3 2008-02-14 06:48:10

Zyx
Member
From: Poland
Registered: 2006-12-09
Posts: 20
Website

Re: Lighttpd + simple vhosts don't work at all.

It works, thanks. The only inconvenience is that I must add every subdomain manually, but it's better than not working at all smile.

Offline

Board footer

Powered by FluxBB