lighttpd.conf needs doesn't work
I moved the lighttpd.conf to /etc/lighttpd/conf-available/. Right now the server can only load the default page, but no other pages (404).
Now I do:
lighty-enable-mod lighttpd
which enables the config. But after this lighttpd won't start anymore. The logs mention multiple files (the server config, the grav config and the perl file that includes configs).
When I disable the config, the default page works again, but nothing else.
The only thing I changed in the config was (using vim):
:%s/\/grav_path\///g
and I manually edited the one on line 45 (removed "/grav_path").
You should rename all the references to /grav_path with your actual path to the server as noted in the file:
############# DO NOT FORGET TO CHANGE "grav_path" BY YOUR ACTUAL GRAV INSTALLATION FOLDER #############
############# IF GRAV IS AT THE ROOT OF YOUR WEBSITE, ie http://yoursite.tld POINTS TO #############
############# GRAV DIRECTLY, THEN JUST REMOVE ANY "/grav_path/" MENTION BELOW. OTHERWISE #############
############# WE ASSUME YOU RUN AN INSTALLATION SUCH AS http://yoursite.tld/grav_path/ #############
#######################################################################################################
I did like I mentioned before. Grav is sitting in the www root. So I replaced all instances of /grav_path/ with null (thus removing it). I also tried replacing /grav_path/ with '/'. Didn't work either.
Fixed by commenting out:
#url.access-deny = (".md","~",".inc")
A little bit late, but after 3 years since this issue has been reported it seems that the lighttpd configuration still doesn't work out of the box.
An alternative which seems to be working on my side, is the following:
-url.access-deny = (".md","~",".inc")
+url.access-deny += (".md","~",".inc")
Probably better than commenting the line, IMO. Based on the documentation, this should append the additional extensions to the option. It also works with := (replace/overwrite earlier value). Still not sure why it doesn't work with a simple =.
@iulian3144 As you're on it, please look if you can match the rules from .htaccess file as it has been updated to prevent more attacks and folders in the installation.
None of the developers have the Lighttpd server installed making me scared to update the file blindly.
@mahagr I actually started messing with lighttpd the day before I added my comment. I'll have a look though when I'll find some time.
Please add server.modules += ("mod_rewrite") to the sample Lighttpd conf, to enable url.rewrite-if-not-file to actually work. Otherwise, you'll get an error to the tune of this when restarting lighttpd:
WARNING: unknown config-key: url.rewrite-not-in-file
Debian 12 as of now ships with Lighttpd_mod_rewrite installed but not enabled in the config.
Seeing as how Grav and lighttpd share the same lightweight ethos, it's surprising more devs don't help with lighttpd.
On my install, the advice to remove /grav_path/ for root installation seems to be wrong. You would need to replace only /grav_path throughout the file. lighttpd 1.4.69.