Page 1 of 1

Subdomains bei lighttpd

Posted: 2006-09-14 10:20
by malo
sorry ich noch ma :)


ich include in der lighttpd.conf immer die diversen domain confs
mit

Code: Select all

#domain.de
include "domain.de.conf"
in diesen conf´s steht z.B.

Code: Select all

$HTTP["host"] =~ "(^www.domain.de|^domain.de)" {
    server.indexfiles          = ( "index.php","index.html" )
    server.document-root       = "/var/www/domain.de/html"
    server.error-handler-404   = "/error404.php"
    accesslog.filename         = "/var/www/domain.de/log/access.log"
}
das geht auch alles
wie bzw was muss ich nun angeben damit z.b der Ordner http://domain.de/party per subdomain: http://party.domain.de erreichbar ist?

danke für die hilfe!
gruss

Re: Subdomains bei lighttpd

Posted: 2006-09-14 11:20
by Roger Wilco
Malo wrote:wie bzw was muss ich nun angeben damit z.b der Ordner http://domain.de/party per subdomain: http://party.domain.de erreichbar ist?
Du vergleichst $HTTP["host"] mit der gewünschten Subdomain und leitest den Client dann mit der entsprechenden Direktive aus mod_redirect um. Alternativ setzt du einfach das DocumentRoot dieses "VirtualHosts" auf "/var/www/example.com/html/party".

Re: Subdomains bei lighttpd

Posted: 2006-09-14 13:06
by malo
hi danke, habs hinbekommen.

ich poste mal meinen code, evtl haben ja das selbe problem in der zukunft.

ind die lighttpd.con muss folgendes
wichtig ist, das der eintrag der subdomain über der von der hauptdomain ist.

Code: Select all

$HTTP["host"] == "sub.domain.de" {
    server.indexfiles          = ( "index.php","index.html" )
    server.document-root       = "/var/www/domain.de/html/subordner"
    server.error-handler-404   = "/error404.php"
    accesslog.filename         = "/var/www/domain.de/log/access.log"
}


$HTTP["host"] =~ "(^www.domain.de|^domain.de)" {
    server.indexfiles          = ( "index.php","index.html" )
    server.document-root       = "/var/www/domain.de/html"
    server.error-handler-404   = "/error404.php"
    accesslog.filename         = "/var/www/domain.de/log/access.log"
}