up vote 1 down vote favorite
share [g+] share [fb]
$HTTP["host"] == "example.com" {
    server.document-root		= "/var/www/vhosts/example.com/httpdocs/development/api"
    server.errorlog			= "/var/log/lighttpd/error.log"
    accesslog.filename			= "/var/log/lighttpd/access.log"
}

$HTTP["host"] == "api.example.com" {
    server.document-root		= "/var/www/vhosts/example.com/httpdocs/development/api"
    server.errorlog			= "/var/log/lighttpd/error.log"
    accesslog.filename			= "/var/log/lighttpd/access.log"
}

$HTTP["host"] == "example.org" {
    server.document-root		= "/var/www/vhosts/example.com/httpdocs/development/services"
    server.errorlog			= "/var/log/lighttpd/error.log"
    accesslog.filename			= "/var/log/lighttpd/access.log"
}

Above is an extract of my lighttpd.conf. example.com and example.org are working fine. Any idea why api.example.com refuses to work?

Thanks!

link|improve this question

46% accept rate
What exactly do you mean by "refuses to work"? – emills Oct 10 '09 at 20:59
Does not load, as if the domain didn't exist. – James Oct 10 '09 at 21:03
feedback

1 Answer

up vote 1 down vote accepted

Make sure "api.example.com" resolves to the IP of your server in DNS.

link|improve this answer
An A record, right? – James Oct 10 '09 at 21:41
Fantastic, you have saved my life of pain :) – James Oct 10 '09 at 21:41
You can either do an A record or a CNAME to the true dns name of the server. It's your choice. – emills Oct 10 '09 at 22:41
feedback

Your Answer

 
or
required, but never shown

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