lighttpd simple-vhost question
I've used the following
> simple-vhost.server-root = "/var/www/"
simple-vhost.default-host = "localhost"
simple-vhost.document-root = "/www/"
Which works fine for
Any help would be great, thanks in advance
5 Replies
eg
mkdir /var/www/domain1.com
mkdir /var/www/domain2.com
Now "
So what I do is symlink them
cd /var/www
ln -s domain1.com www.domain1.com
Now requests for "domain1.com" and "
From what I've read the vhost looks in the directory name based on those three settings.
So for domain1.com would be /var/www/domain1.com/www/ and
Is it as easy as putting a sym link for
1) The symlink method. This works just fine.
2) The redirect method. I've become cantankerous and determined that
Anyway, here's the config I'm using for that:
$HTTP["host"] !~ "^(www\..*)$" {
## The document root of a virtual host isdocument-root =
## simple-vhost.server-root + $HTTP["host"] + simple-vhost.document-root
simple-vhost.server-root = "/var/www"
simple-vhost.document-root = "/html/"
## the default host if no host is sent
simple-vhost.default-host = "default-fall-through.hoopycat.com"
}
# www.*
$HTTP["host"] =~ "^www\.(.*)" { url.redirect = ( "^/(.*)" => "http://%1/$1" ) }
Doing it the other way – redirecting from
I thought it would be possible to setup something using simple-vhost that could capture the domain and any possible sub-domains for any pointed to my linode.
I've been trying to find other examples after the one hoopycat posted but failed.
Can you use regex with simple-vhost?