Owner and Perm of Web Items in FreeBSD
The following steps provide all directories and files in the "data" folder with the appropriate ownership and permissions to ensure smooth operation of the web server. This also prevents unauthorized users from viewing and modifying them.
user@host: $ su -
2. Change ownership of all items to user "root" and group "www".
root@host: # chown -R root:www /usr/local/www/apache24/data
3. Change permission modes to 750 for directories only. User "root" can (r)ead, (w)rite, and e(x)ecute directories. Users included in the group "www" can (r)ead and e(x)ecute but NOT write to directories. All other users are excluded.
root@host: # find /usr/local/www/apache24/data -type d -exec chmod 750 {} +
4. Change permission modes to 640 for files only. User "root" can (r)ead and (w)rite but NOT execute files. Users included in the group "www" can (r)ead but NEITHER write NOR execute files. All other users are excluded.
root@host: # find /usr/local/www/apache24/data -type f -exec chmod 640 {} +
5. Log out from "root".
root@host: # exit
==========
For Debian-based Linux distributions, the process is similar but the names and paths are different as shown here.
==========
Comments
Post a Comment