Tag Archives: selinux

SELinux and Ports

Here is an example of how ports are controlled by SELinux. Say that the port that apache uses was changed to 1000 when you start apache you get these errors [root@server01 conf]# systemctl status httpd httpd.service – The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/httpd.service.d └─php-fpm.conf Active: failed (Result: exit-code)… Read More »

SELinux and file contexts

apache root document folder was changed from normal folder to /repos folder attempting to get index.html resutls in an error [root@server01 repos]# curl localhost/index.html Forbidden You don’t have permission to access /index.html on this server. set the correct context on the new folder [root@server01 repos]# semanage fcontext -a -t httpd_sys_content_t “/repos(/.*)?” check the context [root@server01… Read More »