Apache has no way to limit the number of directories in a project PHP files can be accessed, other PHP files cannot be accessed.
The problem seems simple, but I can't find a way to break my head.
I've been searching for Google or something. Solving.
Reply content:
Apache has no way to limit the number of directories in a project PHP files can be accessed, other PHP files cannot be accessed.
The problem seems simple, but I can't find a way to break my head.
I've been searching for Google or something. Solving.
What do you mean by "can be accessed", can the browser be accessed via HTTP?
For example, www/html, Www/pub, www/private three directories, only http://test.com/html, http://test.com/pub can access, Access http://test.com/ Private times 403 Forbidden error.
If this is the demand, Apache can do it:
Order Deny,Allow Deny from all
For details, see: http://httpd.apache.org/docs/current/mod/mod_access_compat.html
After Apache is installed, there is an example configuration in the httpd.conf that comes with it.
If you say that the access refers to "PHP include", such as www/index.php, can include www/html, www/pub two directory files, but include www/private under the file, reported permission Denied, then you just set the Www/private permissions to 766, and let the Apache process owner is not the owner of the Www/private directory
The simplest solution to change the directory structure ... Get those files in the same directory