SELinux and UserDir

Hello all,

New to the community. I am working on setting up my servers with Rocky 9.3 and allowing my users to have web directories. i.e public_html. I have enabled the UserDir in /etc/httpd.conf/userdir.conf file and have set the SELinux boolean as follows: setsebool -P httpd_enable_homedirs true. I must be missing something as I still get an access error. This is just a local machine without https at this point.

The user’s home directory needs to be set to at least mode 701 (rwx-----x), public_html can be set to 755. Ensure you have set the proper permissions. Failing this, check the httpd logs in /var/log/httpd.

The “access error” can come from multiple places. First check selinux report to make sure it really is an seliux problem. It could be directory permissions, or it could be the web server doesn’t think it should allow browsing to the web “location”, not to be confused wtih the filesystem directory. Web server error log is a good place to start.

1 Like

Solved it with setsebool -P httpd_read_user_content on. Thanks for the help.

1 Like