Here i will explain how did i do it,
hoping it will help someone looking for some extra security with SELinux.
Please correct me if i am wrong.
Special Thanks to Nikolay! (you will find on this forum )
Please Read this whole Thread before you making changes to your system!
------------------------------------------------------------------------------------------
Plesk 11 | CentOS 6_64bit & SELinux - Enforcing (Newly Built VPS)
# getenforce
if you find it 'Disable' your system not running SELinux. if it is 'permissive' you can skip the next step.
-Disabled-
# vi /etc/selinux/config
and change,
SELINUX=permissive
then
# reboot
------------------------------------After restarting------------------------------------------------------------
# getenforce
Permissive
----------------------------------Then you can change SELinux-------------------------------------------------
if
# semanage
returns you,
-bash: semanage: command not found
to manage SELinux you will require to install a extension
# yum install policycoreutils-python-2.0.83-19.30.el6.x86_64
(Use '# yum provides /usr/sbin/semanage' to find the current version available)
------------------------------------Applying Plesk SELinux Module Policy-----------------------------------------
# bash selinux_policy_upgrade_trigger.sh
# semodule -s targeted -i /usr/local/psa/etc/plesk.pp (Not Sure you have to do this or not, well i did it)
Then
# semodule -l (make sure plesk is there)
-----------------------------------now "Force SELinux"------------------------------------------------------------
# setenforce 1
# getenforce
Enforcing
-----------------------------------Restart all the services you are using--------------------------------------------
Most Probably you will find "httpd" not restarting with msg and a port,
-use
# semanage port -a -t http_port_t -p tcp YOUR_PORT (you will have to do this few times until all your ports added to SELinux)
----------------------------------- PHP Session Directory---------------------------------------------------------
You will not able to write session when you are running php as FastCGI
to fix this,
chown apachesacln /var/lib/php/session/
chcon system_ubject_r:httpd_sys_content_t:s0 /var/lib/php/session/
-----------------------------------You are Done!-------------------------------------------------------------------
Please use /var/log/audit/audit.log to see which services have been denied, you can use 'audit2allow' to fix them (please search on next about audit2allow)
------------------------------------When everything done!------------------------------------------------------
# vi /etc/selinux/config
and change,
SELINUX= enforcing
then
# reboot
-----------------------------------------------------------------------------------------------------------------
Plesk is not recommending to use SELinux, if you Enable SELinux, always keep in mind you Enabled it.
Use,
# setenforce 0
to get SELinux to 'permissive' Mode (only log ing)
and check the audit log for the your if it is related problem!
hoping it will help someone looking for some extra security with SELinux.
Please correct me if i am wrong.
Special Thanks to Nikolay! (you will find on this forum )
Please Read this whole Thread before you making changes to your system!
------------------------------------------------------------------------------------------
Plesk 11 | CentOS 6_64bit & SELinux - Enforcing (Newly Built VPS)
# getenforce
if you find it 'Disable' your system not running SELinux. if it is 'permissive' you can skip the next step.
-Disabled-
# vi /etc/selinux/config
and change,
SELINUX=permissive
then
# reboot
------------------------------------After restarting------------------------------------------------------------
# getenforce
Permissive
----------------------------------Then you can change SELinux-------------------------------------------------
if
# semanage
returns you,
-bash: semanage: command not found
to manage SELinux you will require to install a extension
# yum install policycoreutils-python-2.0.83-19.30.el6.x86_64
(Use '# yum provides /usr/sbin/semanage' to find the current version available)
------------------------------------Applying Plesk SELinux Module Policy-----------------------------------------
# bash selinux_policy_upgrade_trigger.sh
# semodule -s targeted -i /usr/local/psa/etc/plesk.pp (Not Sure you have to do this or not, well i did it)
Then
# semodule -l (make sure plesk is there)
-----------------------------------now "Force SELinux"------------------------------------------------------------
# setenforce 1
# getenforce
Enforcing
-----------------------------------Restart all the services you are using--------------------------------------------
Most Probably you will find "httpd" not restarting with msg and a port,
-use
# semanage port -a -t http_port_t -p tcp YOUR_PORT (you will have to do this few times until all your ports added to SELinux)
----------------------------------- PHP Session Directory---------------------------------------------------------
You will not able to write session when you are running php as FastCGI
to fix this,
chown apachesacln /var/lib/php/session/
chcon system_ubject_r:httpd_sys_content_t:s0 /var/lib/php/session/
-----------------------------------You are Done!-------------------------------------------------------------------
Please use /var/log/audit/audit.log to see which services have been denied, you can use 'audit2allow' to fix them (please search on next about audit2allow)
------------------------------------When everything done!------------------------------------------------------
# vi /etc/selinux/config
and change,
SELINUX= enforcing
then
# reboot
-----------------------------------------------------------------------------------------------------------------
Plesk is not recommending to use SELinux, if you Enable SELinux, always keep in mind you Enabled it.
Use,
# setenforce 0
to get SELinux to 'permissive' Mode (only log ing)
and check the audit log for the your if it is related problem!
Last edited: