Skip to content


Require Authentication For Multiple Directories in Lighttpd

I have a domain that I use to hold my notes, personal wiki, html versions of books and magazines, and other assorted resources. Much of this I want to remain private so I’ve implemented Lighttpd access restrictions at the root of those directories. I had a little bit of trouble this evening adding additional directories to my restriction list, so I thought I would make a note of it here. Hopefully it’ll help anyone else running into similar trouble. <br /> $HTTP["host"] =~ "domain.tld" {<br /> auth.require = (<br /> "/secret/" => (<br /> "method" => "basic",<br /> "realm" => "Password Protected Area",<br /> "require" => "valid-user",<br /> ),<br /> "/private/" => (<br /> "method" => "basic",<br /> "realm" => "Password Protected Area",<br /> "require" => "valid-user",<br /> )<br /> )<br /> } The cause of my problem was the missing comma between the directory names. If you’re going to limit access to multiple directories in a list like this it needs to be a comma separated list. Read more

WordPress Permalink Support: FreeBSD + Lighttpd

I love FreeBSD for how efficient and minimalistic it can be. For my web servers I like to add to this efficiency by using Lighttpd instead of the larger, older, Apache. The one little issue with Lighttpd vs Apache is getting all the same module support setup for all the little tweaks that you’ve come to enjoy. I should mention that Lighttpd supports many of the same modules that Apache does, and once you learn how they work I think they are even more intuitive than Apache’s config. One of the most important to me is the mod_rewrite for use with my WordPress blogs. As you can see from the URL I use fancy addresses for my posts. %date%/%name%, etc. I think this is more user friendly (not to mention Google-friendly) than something like php?=53. What kind of URL is that? In any case, a very simple way to achieve this in Lighttpd is to use the following single line in your lighttpd. Read more