Apache Consolidation directory, file restrictions

Source: Internet
Author: User

If you use a similar Phpstudy integration platform, all the configurations you want to modify are basically set up on the Phpstudy.
But if your server is a step-by-step installation (Apache+php+mysql), then you have to have a certain understanding of the location of the function modification.

One, file type:

Target: http.conf

<files ~ ". bak$" >        Order allow,deny       deny from all </Files>

That is, restrict the file suffixes that can be accessed.

Or:

<filesmatch. (TXT) $>     Order allow,deny     deny from all</filesmatch>

Restrict access to the extended. txt.

  

2. Directory Restrictions

Target: http.conf

<directory ~ "^/var/www/manage" >        Order Allow,deny
Allow 192.168.10.10 Deny from all</directory>

This works well on restricted sensitive catalogs. Under certain conditions, customers can be advised to use this method. Usually use the intranet designated machine maintenance background, the other is disabled.

 

3. Error or debug information

Target: php.ini

Display_errors = On
This function can be opened in the development environment. Easy to see code errors.
It is recommended to turn off this feature in the production environment, otherwise it is easy to cause information disclosure (path, etc.)

  

4. Directory traversal

Target: http.conf

DocumentRoot "D:\phpStudy\WWW"
<directory/>
Options +indexes +followsymlinks +execcgi
AllowOverride All
Order Allow,deny
Allow from all
Require all granted
</Directory>

Modified to: DocumentRoot "D:\phpStudy\WWW"
<directory/>
Options +indexes +followsymlinks +execcgi
AllowOverride All
Order Allow,deny
Allow from all
Require all granted
</Directory>

One of the key locations is:
Indexes


  

Apache Consolidation directory, file restrictions

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.