Introduction

You may need to modify SELinux status due to some restrictions come with this feature/mode. Maybe you have permission issues on your Web Hosting. Even, problems with opening/executing PHP files — e.g. Connection Timed Out errors, 500 errors, etc. — and want to disable SELinux. Either, you may want to apply some restriction to your server by enabling SELinux.

 

Solutions

In the beginning, we’d prefer to check the current status of SELinux. For getting to know, simply type sestatus on the Terminal and will see SELinux status in the first line.

Disabling SELinux)

  1. Open the file /etc/selinux/config with an editor:
    sudo nano /etc/selinux/config
  2. Find the line SELINUX=enforcing and change enforcing to disabled.
    SELINUX=disabled
  3. Restart the server:
    sudo reboot
  4. Now, check the SELinux status by sestatus, you must see:
    SELinux status: disabled

Enabling SELinux)

  1. Open the file /etc/selinux/config with an editor:
    sudo nano /etc/selinux/config
  2. Find the line SELINUX=disabled and change disabled to enforcing.
    SELINUX=enforcing
  3. Restart the server:
    sudo reboot
  4. Now, check the SELinux status by sestatus, you must see:
    SELinux status: enabled
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
trackback
08/15/2020 3:24 PM

[…] If the problem has not resolved and the server keeps getting Connection Timed Out error, try disabling SELinux. […]