I play with lighttpd on a small virtual private server. I have two domains pointing to a server. I am using the latest version of lighttpd and mod_evhost on Ubuntu 8.10.
I am trying to configure a rule so that if someone asks for domain.com or www.domain.com , they get a message from /webroot/domain.com/www/
Similarly, if someone requests sub.domain.com , he receives a message from /webroot/domain.com/sub/
If people request fake.domain.com (where / webroot / domain.com / fake / does not exist), I would like them to be from /webroot/domain.com/www/
The third requirement is not so important, I can deal with people who request subdomains that do not exist, who are served from the root of the server document /webroot/server.com/www/, even if they requested a fake .domain.com
I have included the relevant parts of my lighttpd.conf file below:
server.document-root = "/webroot/server.com/www/"
// regex to match sub.domain.com
$HTTP["host"] =~ "\b[a-zA-Z]\w*\.\b[a-zA-Z]\w*\.\b[a-zA-Z]\w*" {
evhost.path-pattern = "/webroot/%0/%3/"
}
// regex to match domain.com
$HTTP["host"] =~ "\b[a-zA-Z]\w*\.\b[a-zA-Z]\w*" {
evhost.path-pattern = "/webroot/%0/www/"
}
So where am I going wrong? At the moment, all requests *. Domain.com and domain.com are run from /webroot/domain.com/www/
I would appreciate any help that you guys could offer, and if I left something interesting, please tell me!
Cheers rob