Friday, August 05, 2005

Changing role in SELinux enabled FC4

To run a command with a different role, first use newrole to change the role. For example, to switch to the sysadm_r role:
newrole -r sysadm_r

Enabling public_html for Apache in FC4

To enable per-user web directories on SELinux enabled FC3+, edit /etc/httpd/conf/httpd.conf:
  • Comment out the line UserDir disable
  • Add UserDir public_html.
  • Save the file and run service httpd reload
Each user who needs web directories must do the following:
  • Create ~/public_html, and populate it.
  • Change perms with chmod
  • Change the security context of the folder recursively:
    chcon -R -t httpd_user_content_t ~/public_html/
At this point, it should work. If it does not, check to see that the Boolean that enables user home directories is enabled:
  • Run system-config-securitylevel
  • Under the SELinux tab within the Modify SELinux Policy area: enable Allow HTTPD to read home directories.
  • Alternatively, execute
    setsebool httpd_enable_homedirs true

Preventing console message flooding

To prevent kernel messages flooding the console:
dmesg -n 1