Restrict a directory from parsing PHP and User_agent, PHP-related configuration

Source: Internet
Author: User

One, limit a directory to prohibit parsing PHP

1. Core Configuration file Contents
<Directory/data/wwwroot/11.com/upload>
Php_admin_flag engine off
</Directory>

2, curl test directly returned to the PHP source code, did not parse

Ii. Limitation of User_agent

1, user_agent can be understood as the browser identity
2. Core configuration file Contents
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritecond%{http_user_agent}. Curl. [Nc,or]
Rewritecond%{http_user_agent}. baidu.com. [NC]
Rewriterule. *-[F]
</IfModule>
3, curl-a "123123" designated User_agent

Third, the PHP related configuration

1. View PHP configuration file location/usr/local/php/bin/php-i|grep-i "Loaded configuration Files"
2, Date.timezone
Disable_functions
Eval,assert,popen,passthru,escapeshellarg,escapeshellcmd,passthru,exec,system,chroot,scandir,chgrp,chown, Escapeshellcmd,escapeshellarg,shell_exec,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog, Readlink,symlink,leak,popepassthru,stream_socket_server,popen,proc_open,proc_close
Error_log, Log_errors, Display_errors, error_reporting
Open_basedir
Php_admin_value Open_basedir "/data/wwwroot/11.com:/tmp/"

Restrict a directory from parsing PHP and User_agent, PHP-related configuration

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.