2.2.5. Securing the Apache HTTP Server
- This directive is enabled by default, so be sure to use caution when creating symbolic links to the document root of the Web server. For instance, it is a bad idea to provide a symbolic link to
- This directive is enabled by default, but may not be desirable. To prevent visitors from browsing files on the server, remove this directive.
UserDirdirective is disabled by default because it can confirm the presence of a user account on the system. To enable user directory browsing on the server, use the following directives:
UserDir enabled UserDir disabled rootThese directives activate user directory browsing for all user directories other than
/root/. To add users to the list of disabled accounts, add a space-delimited list of users on the
ServerTokensdirective controls the server response header field which is sent back to clients. It includes various information which can be customized using the following parameters:
It is recommended to use the
ServerTokens Full(default option) — provides all available information (OS type and used modules), for example:
Apache/2.0.41 (Unix) PHP/4.2.2 MyMod/1.2
ServerTokens ProductOnly— provides the following information:
ServerTokens Major— provides the following information:
ServerTokens Minor— provides the following information:
ServerTokens Minimal— provides the following information:
ServerTokens OS— provides the following information:
ServerTokens Prodoption so that a possible attacker does not gain any valuable information about your system.
IncludesNoExecdirective. By default, the Server-Side Includes (SSI) module cannot execute commands. It is recommended that you do not change this setting unless absolutely necessary, as it could, potentially, enable an attacker to execute commands on the system.
Removing httpd Modules
httpdmodules to limit the functionality of the HTTP Server. To do so, simply comment out the entire line which loads the module you want to remove in the
/etc/httpd/conf/httpd.conffile. For example, to remove the proxy module, comment out the following line by prepending it with a hash sign:
#LoadModule proxy_module modules/mod_proxy.so
/etc/httpd/conf.d/directory contains configuration files which are used to load modules as well.