How to browse using ~user in Redhat 9.0
In order to be able to browse a user's www folder (or public_html) by using ~user you must do two things:
- Configure apache to allow userdir to do this
- Reset permissions of the users home dir and public_html dir
1) To configure apache to allow ~userdir
First you have find the following part in the Apache config file, /etc/httpd/conf/httpd.conf. (It will be around line 350 to 380)
TIP: If you are editing with vi, hold down <ctrl> and press g to see what line you are on
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory # permissions).
#
UserDir disable
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
#UserDir public_html
# of a username on the system (depending on home directory # permissions).
#
UserDir disable
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
#UserDir public_html
You need to edit two of the lines.
- Comment out the line UserDir disable (put a # at the beginning). This enables userdir.
- Uncomment the line UserDir public_html (remove the #). This sets the users dir to /home/~user/public_html
2) Reset permissions of home and public_html directories
You must also chmod /home/~user/public_html to 755.
Type /etc/init.d/httpd restart.