Click to See Complete Forum and Search --> : Apache Directories CHMOD?


Rickead2000
10-05-2004, 06:39 AM
Hi

We are using virtual hosts with the following structure:

/var/www/web_site_1
/var/www/web_site_2
/var/www/web_site_3

What should I have the "web_site_1", "web_site_2" & "web_site_3" folders chmod'ed to?

Also, lets assume someone wants to run a file from cgi-bin - can they just create their own cgi-bin directory from within their virtual host directory or is it more complicated?

TIA

bwkaz
10-05-2004, 06:29 PM
They need to be readable and executable by whatever user your Apache runs as (nobody or www or httpd or apache or something like that). They need to be writable by the users that will put stuff into them.

Root can always read and write files, and execute directories, so you don't need to worry about that one.

For /cgi-bin/, you'll need to add a ScriptAlias to Apache's configuration to get it working, but I think that once you do that on each virtual server, then yeah it should just be a matter of creating the directory.

blingbling!!
10-05-2004, 08:18 PM
I quite often use chown to make the server root acually belong to apache, e.g.:

chown wwwrun:nouser /var/www/web_site_1

That way you can have the attributes as rw to user only and apache will be ok. I'm not too sure how good this is for security - any comments are welcome!!!

hth
--Robin

p.s. the wwwrun:nouser is the default SUSE setup - yours might be different. The general form is <user>:<group>