PermissionDenied
时间:2007-07-11 来源:opbsder
Error 13 indicates a filesystem permissions problem. That is, Apache was denied access to a file or directory due to incorrect permissions.
On *nix systems, use ls -l to see the current permissions, and see man chmod for details on fixing these.
GNU based systems often have a namei program that helps in viewing the permissions of a complete path.
Make sure that the file to which permission was denied is at least readable by the Apache user (eg -r--r--r-- or 444 as a minimum. -rw-r--r-- or 644 is more usual).
Directories and scripts also need to be 'executable' (dr-xr-xr-x or 555. drwxr-xr-x or 755 is more common). This includes all parent directories of a resource too!
On Linux, you can use the namei command to return permissions of everything in the path to the target file or directory.
namei -m /usr/local/apache/httpd/dir1/dir2/index.html
DO NOT set files or directories to mode 777, even "just to test", even if "it's just a test server". The purpose of a test server is to get things right in a safe environment, not to get away with doing it wrong.
setenforce 0 can be used to test if this is caused by a SELinux issue - in that case, use chcon to fix permissions. Use ls -alZ to view current permissions on such systems.