-   Linux - Server (
-   -   lighttpd alternate server.document-root (

mark_alfred 10-08-2012 01:31 PM

lighttpd alternate server.document-root
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
## 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:


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

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

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

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.

AlucardZero 10-09-2012 01:38 PM

What are the permissions on /media?

mark_alfred 10-29-2012 08:19 AM

Permissions of /media are the same as /var:


drwxr--r-- 19 mark mark 4096 Oct  8 12:22 media/Extra/
drwxr-xr-x  17 root root  4096 Oct 29 08:15 media/
drwxr-xr-x  20 root root  4096 Sep 24 17:46 var/

AlucardZero 10-29-2012 04:55 PM

/media/Extra needs to be traversable for group and other. ie: chmod go+x /media/Extra . Lighty (presumably not running as root) can't get to www, so it 403s you.

mark_alfred 10-30-2012 01:46 AM

Yeah, that was it. Permission issue. Thanks.

All times are GMT -5. The time now is 06:06 AM.