February 2, 2010
Somewhere in the last few server updates, my SSL had broken for KickingDragon, and I couldn’t for the life of me figure out what was going wrong from the configuration files.
I’ve been eyeing LightTPD for a while now, and figured this would be worth a shot. As it turned out, it only took an hour or so and a bit of monkeying with rewrite rules to get everything built and working.
The hardest part for me was rewriting the rewrite rules appropriately so I could maintain my pretty URL’s.
I thought I’d share in case anyone else is having problems. I’ve added liberal comments to help understand things better:
- # All my vhosts share the same ssl data.
- $SERVER["socket"] == ":443" {
- ssl.engine = "enable"
- ssl.pemfile = "/etc/ssl/lighttpd/server.pem"
- }
- # KickingDragon hosts itself as well as
- # my sister's art blog at http://kickingdragon.com/karen
- # I need to handle# rules for rewriting both wordpress blogs properly.
- $HTTP["host"] == "kickingdragon.com" {
- # Karen's stuff sits at karen/wordpress in the file system, but the URL's
- # are http://kickingdragon.com/karen. Rewrite appropriately.
- # Use rewrite-once so multiple rules don't chain.
- url.rewrite-once = (
- # Anything with wp- prefix gets forwarded on
- "^/karen/(wp-.*)$" => "/karen/wordpress/$1",
- # xmlrpc is a literal file - don't go forwarding it to index.
- "^/karen/xmlrpc.php$" => "/karen/wordpress/xmlrpc.php",
- # Wordpress uses index.php as the entry point for code that 'reads' the URL and
- # decide where to go from their. Terminal rule for /karen items.
- "^/karen(/.*)?$" => "/karen/wordpress/index.php/$1",
- # Kicking Dragon's
- # Same as above, but off the root.
- "^/(wp-.*)$" => "wordpress/$1",
- "^/xmlrpc.php$" => "wordpress/xmlrpc.php",
- "^/(.*)?$" => "wordpress/index.php/$1",
- )
- }
Any questions, let me know!
