Apache problem you dont have permission to access /on this server solution

  

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

1, first, view the conf.d/python.conf file

<Directory "Project Path">

Options Indexes FollowSymLinks +Includes

AllowOverride None

Order allow,deny

Allow from all< Br>

</Directory>

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

2. Secondly, since there is no problem with the configuration file, you need to consider http.conf Access rights for users and groups specified in the file. There is a solution for PermissionDenied on the Apache wiki. The link is http://wiki.apache.org/httpd/13PermissionDenied. The translation is as follows:

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

In order to serve files, Apache must have the appropriate permissions to access those files, which are granted by the operating system. In particular, specifying the User or Group in the httpd.conf file must be able to read all the files being served, and find the directory containing those files and all the parent directories up to the root of the file system.

A typical access to a resource on a Unix-like operating system that is not part of the User or Group specified in the httpd.conf file. For normal files, it is 644 -rw-r--r--, for folders Or the CGI script is 755 drwxr-xrx. You may also need to check the extended access rights supported by the operating system (such as SELinux access).

Examples

When accessing /usr/local/apache2/on a UNIX-like operating system You received a Permission Denied error while htdocs/foo/bar.htm.

First, check the access permissions of the file:

$ cd /usr/local/apache2/htdocs/foo $ ls -l bar.htm

If necessary, Fix them:

$ chmod 644 bar.html

Do the same for folders 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

On some systems, the tool namei can be used to list the access rights of different components on each path, and then to find out if there is a permission problem:

$ namei -m /usr/local/apache2/Htdocs/foo/bar.html

3. Finally, if you still haven't solved the problem, you need to check the extended access rights.

Close SELinux with setenforce 0 to see if it solves the problem.

The problem I encountered was that the user specified in the http.conf file did not have access to the directory where the project is located.

Copyright © Windows knowledge All Rights Reserved