grav icon indicating copy to clipboard operation
grav copied to clipboard

lighttpd.conf needs doesn't work

Open f3bruary opened this issue 7 years ago • 8 comments

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").

f3bruary avatar Feb 19 '18 19:02 f3bruary

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/    #############
#######################################################################################################

rhukster avatar Feb 19 '18 20:02 rhukster

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.

f3bruary avatar Feb 19 '18 20:02 f3bruary

Fixed by commenting out:

#url.access-deny = (".md","~",".inc")

f3bruary avatar Feb 20 '18 19:02 f3bruary

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 avatar Jan 17 '21 00:01 iulian3144

@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 avatar Jan 20 '21 13:01 mahagr

@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.

iulian3144 avatar Jan 20 '21 17:01 iulian3144

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.

jfritz avatar Mar 17 '25 22:03 jfritz

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.

jfritz avatar Mar 18 '25 03:03 jfritz