http://jseb.ca/" itemprop="description"/>

jsebean.com

Jonah's blog is here

I couldn't upload images to htmly with my lighttpd config. Further, the lighttpd config blocked my favicon.ico file. All images would result in a 404 when uploaded, despite ls-ing to the directory shows it uploaded successfully. I'm not using vhost with lighttpd... and honestly ... I blindly copied and pasted the config directly from the htmly documentation found on the github readme (and of course... enabled the rewrite mod in lighttpd.conf which is as simple as uncommenting. The verbatim code was:

$HTTP["url"] =~ "^/config" {
  url.access-deny = ( "" )
}
$HTTP["url"] =~ "^/system/includes" {
  url.access-deny = ( "" )
}
$HTTP["url"] =~ "^/system/admin/views" {
  url.access-deny = ( "" )
}

url.rewrite-once = (
  "^/(themes|system|vendor)/(.*)" => "$0",
  "^/(.*\.php)" => "$0",

  # Everything else is handles by htmly
  "^/(.*)$" => "/index.php/$1"
)

My issue was I would get 404s on images I upload. So I modified the line "^/(themes|system|vendor)/(.*)" => "$0", to show "^/(themes|system|vendor|content/images)/(.*)" => "$0", where content/images is where the images reside when you upload them with htmly.

Next, I added a line directly below it "^/(favicon\.ico|robots\.txt|humans\.txt|sitemap\.xml)$" => "$0", which of course, ensures favicon.ico, robots.txt, humans.txt and sitemap.xml actually works.

It works. It's not perfect. I want to be able to create other directories without rewrite screwing me over for hosting random files and whatever else I feel like. Perhaps I'll setup proper vhosts and elaborate on that down the road as I work on this site. For now the config is in /etc/lighttpd/lighttpd.conf at the bottom, and it gets the job done, so I'm happy.

FWIW... here is my entire config I ended up modifying to for those of you who also want to blindly copy and paste :P

$HTTP["url"] =~ "^/config" {
  url.access-deny = ( "" )
}
$HTTP["url"] =~ "^/system/includes" {
  url.access-deny = ( "" )
}
$HTTP["url"] =~ "^/system/admin/views" {
  url.access-deny = ( "" )
}

url.rewrite-once = (
  "^/(themes|system|vendor|content/images)/(.*)" => "$0",
  "^/(favicon\.ico|robots\.txt|humans\.txt|sitemap\.xml)$" => "$0",
  "^/(.*\.php)" => "$0",

  # Everything else is handles by htmly
  "^/(.*)$" => "/index.php/$1"
)

But yeah.... fixes that issue for you lighttpd users out there who can't upload images with the htmly platform :)

Why am I using lighttpd? Well certainly apache is out of the picture for a 128MB Low End Box. Lighttpd was the choice mainly because I've used it more than nginx. I like nginx and have used it a bit but lighttpd gets the job done for me where I have more experience with it (it use to serve the chickentalk.org forums I used to run a few years ago well so you can say I used it in "production") and is rock stable as far as I can tell for all the memory leak complaining I've heard about in the past, so I use it.

Perhaps one day I'll switch to nginx since that's where the community is at, but old habits die hard. It's always been my goto apache alternative.