Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Aug 2004 03:36:39 -0700 (PDT)
From:      Dirk-Willem van Gulik <dirkx@webweaving.org>
To:        RYAN vAN GINNEKEN <maillist@computerking.ca>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: apache permission problem please help
Message-ID:  <20040825033105.X7510@skutsje.san.webweaving.org>
In-Reply-To: <412BB5F1.8030601@computerking.ca>
References:  <412BB5F1.8030601@computerking.ca>

next in thread | previous in thread | raw e-mail | index | archive | help

Apache (propably) runs as the 'www' user and group.

So each file (and path) needs to be readable by

->	the www group
OR	the www users must be a member of the group
	of the diretory
OR	the world

And each directory needs the 'x' access flag set.

See the man pages for chmod, chown and chgrp for more details

Example:

	drwxr-xr-x  10 dirkx  staff            512 Nov 12  2003 swad
	-rw-r--r--   1 dirkx  staff         711332 Sep 24  2003 tabellenWADI.pdf

Can be seen by www (world readable and directory has x)

	drwxr-x--  10 dirkx  staff            512 Nov 12  2003 swad
	-rw-r----   1 dirkx  staff         711332 Sep 24  2003 tabellenWADI.pdf

Cannot be seen by www UNLESS www is a member of 'staff' (i.e. www is in
the staff line in /etc/group).

	drwx----  10 dirkx  staff            512 Nov 12  2003 swad
	-rw-----   1 dirkx  staff         711332 Sep 24  2003  tabellenWADI.pdf

Can never be seen by the web server as it runs as 'www'.

Note that the web server needs to traverse the entire path; so for a file
ro dir /home/dirkx/public_html/index.html check:

	/
	/home
	/home/dirkx
	/home/dirkx/pulic_html

for an x in world/other or the right group
and the file

	/home/dirkx/public_html/index.html

for read. If you want something different read the manual of apache, and
in particular the SUID mode. See also the FAQ of apache.

Dw.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040825033105.X7510>