You don't have permission to access/on this server solution

Source: Internet
Author: User

You don't have permission to access/on this server solution

The project is deployed on the Apache Http Server, and the configuration file is detected through apachectl-t. However, "you don't have permission to access/on this server" appears in the browser ".

The project is deployed on the Apache Http Server, and the configuration file is detected through apachectl-t. However, "you don't have permission to access/on this server" appears in the browser ".

1. First, check the conf. d/python. conf file.

<Directory "project path">

Options Indexes FollowSymLinks + Includes

AllowOverride None

Order allow, deny

Allow from all

</Directory>

The red part above indicates that anyone is allowed to access the directory.

2. Since the configuration file is correct, you need to consider the access permissions of users and groups specified in the http. conf file. On the Apache wiki, you can find a solution for PermissionDenied. The link is http://wiki.apache.org/httpd/13permissiondenied:

Error 13 indicates that the access permission of the file system is incorrect. That is, apache is denied access due to incorrect permissions. In general, this does not mean that there is an error in the Apache configuration file.

To provide services to files, Apache must have the appropriate permissions to access those files, which are granted by the operating system. In particular, the User or Group specified in the httpd. conf file must be able to read all the files to be served, and find the directories containing those files and all the parent directories until the root of the file system.

A unix-like operating system does not belong to httpd. the typical access permission of the User or Group resources specified in the conf file. For normal files, the permission is 644-rw-r --, for a folder or CGI script, it is 755 drwxr-x-r-x. You may also need to view the extended access permissions supported by the operating system (such as SELinux access permissions ).

Example

When the/usr/local/apache2/htdocs/foo/bar.htm file in a unix operating system is used, you receive the Permission Denied error.

First, view the Object Access Permissions:

$ Cd/usr/local/apache2/htdocs/foo
$ Ls-l bar.htm

If necessary, fix them:

$ Chmod 644 bar.html

Perform the same operations on the folder and each parent folder (/usr/local/apache2/htdocs/foo,/usr/local/apache2/htdocs,/usr/local/apache2, /usr/local/,/usr ):

$ Ls-la
$ Chmod + x
$ Cd ..
$ # Repeat up to the root

In some systems, you can use the tool namei to list the access permissions of different components on each path, and then identify whether there is a permission problem:

$ Namei-m/usr/local/apache2/htdocs/foo/bar.html

3. If the problem persists, check the extended access permission.

Use setenforce 0 to disable SELinux and check whether the problem is resolved.

The problem I encountered is that the user specified in the http. conf file has no permission to access the directory of the project.

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.