Apache-related security settings

Source: Internet
Author: User

After installing Apache2.2 and PHP 5.2.14, the configuration completed the first time that the Apache 2 Test Page was launched with HTTPD, with the following hints: The solution to this problem is:1. Find a file called welcome.conf, generally in/etc/httpd/conf.d2. Comment out all the lines of this file, which are preceded by #, so that the Apache 2 test page is not executed. --------------------------------------------------------------------------------------------------------------- -------Whether it is a Linux server or a Windows server, when you configure the Web environment, you use APAHCE to list the site directory files. This is bad for security, and can be modified in the following three ways.

The first method, the simplest one. Can be entered in the. htaccess file of the root directory<files *>
options-indexes
</Files>
You can stop Apache from listing the directory structure.


By default if you enter the address in the browser http://localhost:8080/, if you have index.html in the root directory of your file, the browser will display index.html content, if there is no index.html, the browser displays a directory listing of the root directory of the file, which includes files and subdirectories under the root directory of the file.

The second method is to prevent Apache from displaying a list of directory structures, just remove the Indexes in Option, for example, let's look at the directory configuration of a directory: <directory "D:/apa/blabla" >
Options Indexes followsymlinks #---------->options followsymlinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
You only need to remove the Indexes from the above code to prevent Apache from displaying the directory structure. The user will not see a list of files and subdirectories under that directory. The function of Indexes is that when there is no index.html file in the directory, the directory structure is displayed, and the list of the directory is not displayed if Indexes,apache is removed. The third way to find <directory "D:/apa/blabla" >
Options Indexes followsymlinks #---------->options -Indexes followsymlinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory> in the options Indexes followsymlinks in front of the Indexes plus – symbol "Remarks: Before Indexes, plus + represents allow directory browsing; plus – disables directory browsing. 】-------------------------------------------------------------------------------------------------to hide the version number as safe as possible, set the following:
serversignature off
Servertokens Prod

Apache-related security settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.