Apache and SELinux

Apache and SELinux

The following selinux contexts are important for an apache web server:
  •     system_u:object_r:httpd_config_t  - For config files in /etc/httpd/conf and conf.d
  •     system_u:object_r:httpd_log_t  - For logs in /etc/httpd/logs
  •     system_u:object_r:httpd_modules_t - For modules used by httpd daemon
  •     system_u:object_r:httpd_sys_content_t - For web content in /var/www/html so any content outside of this must have context set with:
                chcon -R --reference=/var/www/html /var/www/html/newfolder
                or
                restorecon -R /var/www/html/



No comments: