Oct
11
2009

Userdir apache centos

Setting up user directories for Apache (i.e. ~user) on CentOS 5:
Change the /etc/httpd/conf/httpd.conf to comment out:
UserDir disable
and un-comment:
UserDir public_html
Restart Apache.
Create a public_html directory in the user’s home directory.
Make sure it has permissions 0755.
Make sure their home directory has permission 0711.
Make sure that public_html directory has SELinux context:
user_u:object_r:httpd_sys_content_t
Make sure that the SELinux boolean httpd_enable_homedirs is set to “on”.

# mkdir /etc/skel/public_html
# mkdir /etc/skel/public_html/cgi-bin
# chmod 705 /etc/skel/public_html
# chmod 705 /etc/skel/public_html/cgi-bin/

# echo ‘Test User Page !’ > /etc/skel/public_html/index.html
# chmod 604 /etc/skel/public_html/index.html

### SELinux ONLY – Enable User Website
# setsebool -P httpd_enable_homedirs true
# chcon -v -R -h -u user_u -t httpd_user_content_t /home/*/public_html

About the Author: Urban Cetinski

Urban Cetinski :)

Leave a comment

Get Adobe Flash playerPlugin by wpburn.com wordpress themes