CentOS serving home directory with Apache
19, Jul 2012
If you want to setup CentOS to allow Apache to serve out the user home directories there's a couple of quick settings that need to be changed.
First, edit /etc/httpd/conf/httpd.conf, and find the section that begins:
Comment out UserDir disabled, and uncomment the line saying UserDir public_html.
Then, restart httpd, and change one of the SeLinux booleans:
service httpd restart setsebool httpd_read_user_content on
The final thing to make sure of is that the /home/username folder is world executable, and make the public_html folder:
chmod a+x ~/ mkdir ~/public_html echo "Hello World" > ~/public_html/index.html
That's it! Go load your website and rejoice.
Have Something to Say?
Questions? Comments? Concerns? Let me know what you’re thinking.