Permisson for /var/www

Avi Greenbury lists at avi.co
Tue Aug 2 08:49:08 UTC 2011


Amrit Pal Pathak wrote:
> What permission should i give to /var/www directory so that i can
> access all directories and files from /var/www by browser without any
> issue ?

For a standard PHP or HTML site, the web server needs to be able to read
all the files, and ideally not write to them, and read and execute all
directories.
I tend to chown them to root:www-data and use the group bits to control
what the webserver may do with any particular file, though it's more
common to ape the userdir config and instead create a unix user for
each site, serving it out of some directory (usually public_html) in
their home directory. In that instance, I'd make that directory owned
by that user, and set the group to www-data.

It gets a bit more complicated with CGI, and/or if you're using suexec
or similar, which I'm assuming you're not.

-- 
Avi




More information about the ubuntu-users mailing list