3
$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!

2
  • What exactly do you mean by "refuses to work"?
    – emills
    Oct 10, 2009 at 20:59
  • Does not load, as if the domain didn't exist.
    – James
    Oct 10, 2009 at 21:03

1 Answer 1

3

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

3
  • An A record, right?
    – James
    Oct 10, 2009 at 21:41
  • Fantastic, you have saved my life of pain :)
    – James
    Oct 10, 2009 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, 2009 at 22:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .