Introduction
cPanel & WHM is not compatible with SELinux. Leaving SELinux enabled could cause a myriad of issues or features not working. Additionally, this is a step that is required to perform before the cPanel & WHM software is installed:
System Requirements: Disable SELinux | cPanel Docs
Procedure
Log into your server as root via the command-line and open the file "/etc/selinux/config" with your preferred text editor:
nano /etc/selinux/config
By default, the file will look similar to the following:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
With your preferred text editor, change the line "SELINUX=enforcing" to "SELINUX=disabled".
Please note, the "SELINUX=disabled" line must not begin with a "#" or the changes will not take effect.
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
On Enterprise Linux 9 systems (AlmaLinux 9, Rocky Linux 9), you must also ensure the kernel parameters are updated:
grubby --update-kernel ALL --args selinux=0
After these steps are complete, be sure to reboot your server.
To verify the changes took place, use the "sestatus" command as root:
sestatus
The desired output will show "Disabled"
SELinux status: disabled
Comments
0 comments
Article is closed for comments.