6.23. Setting Correct File Permissions
Problem
You want to set file permissions to provide the maximum level of security.
Solution
The bin directory under the
ServerRoot should be owned by user
root, group root, and have file permissions of 755 (rwxr-xr-x). Files contained therein should
also be owned by root.root and be mode 755.
Document directories, such as htdocs, cgi-bin, and icons, will have to have permissions set in a way that makes the most sense for the development model of your particular Web site, but under no circumstances should any of these directories or files contained in them be writable by the Web server user.
Tip
The solution provided here is specific to Unixish systems. Users of other operating systems should adhere to the principles laid out here, although the actual implementation will vary.
The conf directory should be readable and writable only by root, as should all the files contained therein.
The include and libexec directories should be readable by everyone, writable by no one.
The logs directory should be owned and writable by root. You may, if you like, permit other users to read files in this directory, as it is often useful for users to be able to access their logfiles, particularly for troubleshooting purposes.
The man directory should be readable by all users.
Finally, the proxy directory should be owned by and writable by the server user.
Tip
On most Unixish file systems, a directory
must have the x bit set in order
for the files therein to be visible.
Discussion ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access