Project

General

Profile

[solved] lighttpd alternate server.document-root

Added by MarkGrieveson over 12 years ago

Hello. I am trying to change the server.document-root of lighttpd, but I can't seem to get it to work. When I do so, it gives me a 403 - Forbidden error.

Here is a relevant section from my lighttpd.conf file:

@## a static document-root, for virtual-hosting take look at the
  1. server.virtual-* options
    #server.document-root = "/var/www/htdocs-lighttpd"
    server.document-root = "/media/Extra/www/htdocs-lighttpd"@

When I use the first server.document-root ("/var/www/htdocs-lighttpd"), it works. However, the second one, which is on a hard drive with more space, does not work. I have copied the "www/htdocs-lighttpd" directory from "/var/" to "/media/Extra/", and ensured that the ownership and permissions are the same:

@vector://
root:# ls -l var
drwxr-xr-x 3 lighttpd lighttpd 4096 Sep 25 12:33 www/

root:# cd var
vector://var
root:# ls -l www
total 4
drwxr-xr-x 9 root root 4096 Oct 8 11:37 htdocs-lighttpd/

vector://var
root:# cd /media/Extra
vector://media/Extra
root:# ls -l
drwxr-xr-x 3 lighttpd lighttpd 4096 Oct 8 12:22 www/

vector://media/Extra
root:# ls -l www
total 4
drwxr-xr-x 2 root root 4096 Oct 8 12:26 htdocs-lighttpd/@

I've obviously neglected to do something, but I'm not sure what.

I am using Vector Linux 7.0. The version number of the package I have installed of lighttpd is 1.4.31-i586-1vl70, which presumably reflects the version of lighttpd I'm using.


Replies (1)

RE: lighttpd alternate server.document-root - Added by MarkGrieveson over 12 years ago

My permissions were wrong. When I recursively changed the ownership of the files to lighttpd:lighttpd (making both owner and group lighttpd) I was able to serve the site from the alternative location.

    (1-1/1)