Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
$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!

share|improve this question
    
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

1 Answer 1

up vote 1 down vote accepted

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

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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