Config in httpd.conf
-
Hide the Apache Version number, and other sensitive information.
ServerSignature Off ServerTokens Prod
The ServerSignature appears on the bottom of pages generated by apache such as 404 pages, directory listings, etc.
The ServerTokens directive is used to determine what Apache will put in the Server HTTP response header. By setting it toProd it sets the HTTP response header as follows:
Server: Apache
-
Make sure apache is running under its own user account and group
User apache Group apache
-
Ensure that files outside the web root are not served
<Directory /> Order Deny,Allow Deny from all Options None AllowOverride None </Directory> <Directory /web> Order Allow,Deny Allow from all </Directory>
-
Turn off directory browsing
Options -Indexes
-
Turn off server side includes
Options -Includes
-
Turn off CGI execution
Options -ExecCGI
-
Don't allow apache to follow symbolic links
Options -FollowSymLinks
-
Turning off multiple Options
Turn off all Options:
Options None
Turn off some Options:
Options -ExecCGI -FollowSymLinks -Indexes
-
Turn off support for .htaccess files
AllowOverride None
-
Lower the Timeout value
Timeout 45
-
Restricting Access by IP
Order Deny,Allow Deny from all Allow from 127.0.0.1
Secure Apache Configuration
最新推荐文章于 2024-08-28 09:43:28 发布