Diet-Web
rss

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:

  1. # All my vhosts share the same ssl data.
  2.  
  3. $SERVER["socket"] == ":443" {
  4.  
  5. ssl.engine = "enable"
  6.  
  7. ssl.pemfile = "/etc/ssl/lighttpd/server.pem"
  8.  
  9. }
  10.  
  11. # KickingDragon hosts itself as well as
  12. # my sister's art blog at http://kickingdragon.com/karen
  13. # I need to handle# rules for rewriting both wordpress blogs properly.
  14. $HTTP["host"] == "kickingdragon.com" {
  15.  
  16. # Karen's stuff sits at karen/wordpress in the file system, but the URL's
  17. # are http://kickingdragon.com/karen.  Rewrite appropriately.
  18.  
  19. # Use rewrite-once so multiple rules don't chain.
  20. url.rewrite-once = (
  21.  
  22. # Anything with wp- prefix gets forwarded on
  23. "^/karen/(wp-.*)$" => "/karen/wordpress/$1",
  24.  
  25. # xmlrpc is a literal file - don't go forwarding it to index.
  26. "^/karen/xmlrpc.php$" => "/karen/wordpress/xmlrpc.php",
  27.  
  28. # Wordpress uses index.php as the entry point for code that 'reads' the URL and
  29. # decide where to go from their.  Terminal rule for /karen items.
  30. "^/karen(/.*)?$" => "/karen/wordpress/index.php/$1",
  31.  
  32. # Kicking Dragon's
  33. # Same as above, but off the root.
  34. "^/(wp-.*)$" => "wordpress/$1",
  35.  
  36. "^/xmlrpc.php$" => "wordpress/xmlrpc.php",
  37.  
  38. "^/(.*)?$" => "wordpress/index.php/$1",
  39.  
  40. )
  41. }

Any questions, let me know!