Problem
I have installed Apache 2.4.6 on an RHEL 7.4 server. Apache installed and configured successfully but when I tried to access a page I got the below error:
Forbidden
You don’t have permission to access / on this server
Reason
RHEL 7.4 comes with SELinux enabled as enforcing, due to this high-security level it restricts some software and functionalities. We can set the SELinux level as Permissive to resolve the above error.
Solution
Follow the below steps to change the SELinux level from Enforcing to Permissive.
- Login to the server as a superuser
- Check the SELinux level using command getenforce. It is showing SELinux level is set to Enforcing.
[root@dbappweb ~]# getenforce Enforcing [root@dbappweb ~]#
- Change the SELinux level from Enforcing to Permissive using command setenforce 0
[root@dbappweb ~]# setenforce 0 [root@dbappweb ~]#
- Verify the changes by using command getenforce
[root@dbappweb ~]# getenforce Permissive [root@dbappweb ~]#
- The above output shows that the SELinux level has been changed from Enforcing to Permissive.
- Now, you can access the page and it will load successfully.
Last Updated: June 20, 2020