
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
322
|
Chapter 10: Securing Web Servers
Logging
The Apache log directories should be owned by root and visible to no one else. Look-
ing at Table 10-3, the default owner is root but the directory permissions are
755 and
file permissions are
644. We can change the directory permissions to 700 and the file
permissions to
600.
Table 10-3. Apache installation defaults
File types Notable files
Red Hat RPM
directories
Source directories
Owner
Dirmode
Filemode
Initialization script httpd /etc/init.d (No standard) root
755
755
Configuration files httpd.conf
access.conf
srm.conf
/etc/httpd/conf /usr/local/apache/conf root
755
644
Logs access_log
error_log
/etc/httpd/logs /usr/local/apache/logs root
755
644
Apache programs httpd
apachectl
/usr/sbin /usr/local/apache/bin root
755
511
Apache utilities htpasswd
apxs
rotatelogs
/usr/sbin /usr/local/apache/bin root
755
755
Modules mod_perl.so /usr/lib/apache /usr/local/apache/libexec root
755
755
CGI programs (CGI scripts) /var/www/cgi-bin /usr/local/apache/cgi-bin root
755
750
a
a
Files should be owned by group apache.
Static content (HTML files) /var/www/html /usr/local/apache/htdocs apache
470
640
Password/datafiles (Varies) (No standard) (No standard) apache
470
640