1

Ok, here it goes... I've seen some other posts dealing with this, but it didn't help that much. I am using Windows XP. My problem is with trying to get lighttpd working with virtual hosts. Now, I managed to get everything up and working with the default /htdocs and the default page shows up just fine on the internet, but since I have several sites to host, I need virtual hosting. I managed to do it in apache, so I guessed it would work out just fine in lighttpd, but apparently I'm missing something.

Ok, let's say I have domain (www.)example.org. I want everyone using that url going to the correct index.html, obviously. Let's say that index.html is in directory websites/website1 placed under the lighttpd dir. (thus, the full path is c:/ProgramsFiles/lighttpd/websites/website1/index.html)

Now: How, exactly, do I set up my virtual host (in the config file)? In detail, please, since I've tried for hours with the vague hints I got from fora and such, but it doesn't work.

Also is there something additional to do? Change the server.bind or get rid of the default server.document-root, or something?

I appreciate all the help you can give! Especially if it's a verbatim/step-by-step solution you're offering!

Edit: And, yes, my mod_simple_vhost has been enabled.

1
  • Maybe you can include what you configurations look like at the moment? Commented Mar 31, 2012 at 13:50

1 Answer 1

3

All you'll need is a config like this:

$HTTP["host"] =~ "(^|www\.)example\.org$" {
    server.document-root = "C:/Program Files/lighttpd/websites/website1/" 
}

Not quite sure how the path needs to be formatted under Windows - maybe escape the space in Program Files?

You don't need mod_simple_vhost unless you're looking to have dynamically configured vhosts based on the domain name.

1
  • Yep, that did it! Thanks a lot! I'm not sure why it isn't mentioned anywhere in the ## explanation in the config file like that. I don't think I would have ever found it, with the $HTTP["host"] =~ "(^|www\.)example\.org$" { -thingy; I just kept trying it the way it was indicated in the ##part of the configfile. Must have tried dozens of variants, to no avail. But anyway, this worked like a charm! Thnks again! Commented Mar 30, 2012 at 22:35

You must log in to answer this question.

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