Prohibit parsing of PHP in a directory, restricting access to user_agent,php related configurations

Source: Internet
Author: User
Tags time zones
Modifying a configuration file

Test

After testing, the content of 123.php cannot be resolved at all.
You can also modify the configuration file again to increase the security level and not allow access to this directory at all

Access Control-user-agent
Modifying a configuration file

F Forbidden
Test Curl

403 is denied, view the next log
^_^ discover that the access log source is Curl


Successful access, and view access logs

PHP Related Configuration
View PHP configuration file Locations

Turn off security-related function functions

Open Browser test after reloading configuration
PHP information has been forbidden to parse the load
Defining time zones

Modify Error Display information

(the error here can also be changed to off, can be effective, or the default with off bar)
Reload Configuration Open Browser test

Test with Curl

Although there is no error, but can not parse and get any content,

To re-modify the configuration file

Turn On Error logging

To modify the logging level of the error log

To modify the location where the error log is saved

After reloading, test with curl and view the location of the error log

If you are concerned that you cannot find a log file, you can

Even create the file first, then change the 777 permissions

Open_basedir
Prevent a website from being hacked, affecting other related directories or websites
Modifying a configuration file

Reload, Curl Test

You can also add a sentence to the Apache vhost configuration file.

Test with Curl

Prohibit parsing of PHP in a directory, restricting access to user_agent,php related configurations

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.