Click to See Complete Forum and Search --> : permissions web server


groundzero
04-11-2001, 11:50 AM
my web site main dir is:
/var/www
/var/www houses all my htmlfiles and images/
also my cgi-bin folder ( that i use)

What should my permisions be for:
/var/www
/var/www/cgi-bin
and the files inside of these directories?
Thanx
GZ :D

Tyr-7BE
04-11-2001, 12:29 PM
Not that I'm super-qualified to answer this question, but the permissions depend on whether or not you want to be root to edit the files/directories. Doint a chmod -Rf 444 /var/www (BE CAREFUL WITH CHMOD -Rf!!! It can really really fsck up your machine) will give everybody read-only permissions...nobody will have write access except root. However, if you want a user to be able to edit the contents, you'll have to "chown -Rf username /var/www" (I believe that's the syntax..."man chown" for more), and then "chmod -Rf 744 /var/www". This will give the user by the name of "username" full permissions to that directory, but everyone else has read-only permissions. Hope this helps and sorry if I've re-hashed a bunch of stuff you know already :)

Craig McPherson
04-11-2001, 02:52 PM
The files can be 644, but the direcories will need to be 755, otherwise nobody can even enter them, and any CGI scripts will need to be 755 also.