Apache HTTP server has been installed on Linux. However, when accessed through a browser, "You don't have permission to access/on this server" appears ".
Google has the following two solutions:
1. There is such a section in the httpd. conf file
<Directory/>
Options followsymlinks
AllowOverride none
Order deny, allow
Deny from all
</Directory>
You can change deny to allow, restart the apache service, and check whether the problem is resolved.
2. Another solution to permissiondenied on Apache wiki is the http://wiki.apache.org/httpd/13PermissionDenied,
Full Text Translation:
(13) 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, in the httpd. conf file, it is pointed out that the user or group must be able to read all the files under service and find the directories containing those files,
And all parent directories to the root of the file system.
When accessing resources of a Unix-like system that do not belong to a user or group, the user or group here is in httpd. the typical access permission specified in the conf file 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:
If you access the/usr/local/apache2/htdocs/Foo/bar.htm file on the Unix-like system, you receive the Permission denied error, first, check the access permissions on the file:
$ CD/usr/local/apache2/htdocs/foo
$ LS-l bar.htm
If necessary, fix them:
$ Chmod 644 bar.html
Then, for the folder and each parent folder (/usr/local/apache2/htdocs/Foo,/usr/local/apache2/htdocs,/usr/local/apache2, /usr/local/,/usr) to perform the same operation:
$ LS-la
$ Chmod + x
$ CD ..
# Repeat the operation until the top layer
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
If the standard access permission configuration is correct, you still get a permission denied error. You should check the extended access permission.
For example, you can use the setenforce 0 command to disable SELinux to check for any errors.
If an error occurs, run the LS-alz command to view the access permissions of SELinux and use chcon to fix them.
Do not set the mode of a file or folder to 777, even if "only for testing ". The purpose of testing the server is to ensure that things are correct in a secure environment, rather than bypassing errors.
3. Sadly, neither of these two methods can be used on my machine. I read HTTP. conf several times and the problem persists. Finally, let me think about it. The problem should be that some development RPM packages are not installed when Linux is installed on a virtual machine. In this way, when Linux is installed for the first time and then configured, some problems may occur, such as domain names, permissions, and inability to automatically obtain IP addresses. Even updating Linux on the original system cannot be solved. In this way, the solution is to delete and reinstall the original Linux system. As a result, the solution is to access the Apache and it works of the Linux System in the virtual machine through the host machine!