I've been researching what I'm sure is a very simple task. Coming from .htaccess to lighttpd.conf, I'm sure I am still missing some important concepts.

I am using lighttpd for a number of virtual hosts, and I would like to set some specific settings for some of the websites. Also, I would want to set folder specific settings for folders that have a different default page and for protected folders.

I guess my main questions is: How are separate website/folder configurations possible with lighttpd?



Not quite sure what you need to accomplish but there are ways to get it done. It will need to be included in your main configuration and a server restart is required to load any modifications as DerfK mentioned.

But it is possible to do the things that you want using some clever regular expressions and/or using lua scripts with mod_magnet.

If you need to limit access to certain protected folders, you can use mod_auth and/or mod_access instead.

However, something like .htaccess files in each folder, will not work very well for lighty.

  • For now, just basic things like a custom default page for that folder, and I will look into the mod_access/mod_auth. Those are still run from the main lighttpd.conf though, huh? – Jonathan Kratzke Dec 9 '10 at 18:58
  • everything runs from the main config. you should be able to specify custom default pages if you wrap them around individual host settings. – sybreon Dec 10 '10 at 0:23
  • But I would have to specify them in the main config file and restart the server, correct? Where can I find directions on how to wrap site specific settings in the main config? – Jonathan Kratzke Dec 10 '10 at 16:35
  • Yes, correct. Refer to the lighttpd wiki. There are examples for doing all kinds of things. – sybreon Dec 11 '10 at 3:23

The official answer is no.

The unofficial answer is that there are hacks that look for lighttpd configuration snippits throughout the web tree and use lighttpd's include_shell statement to run a command when the server starts that finds them all and adds them to the main configuration, but 1) they're attached to the main configuration so a malicious user can mess with the main configuration and 2) they're only read when the server starts, changing one requires restarting the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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