Apache allows you do have a URL which starts with /~username.
This redirects the server to look for files in /home/username/public_html/.
So for instance http://machine/~dave/hello.html would look for a file
in /home/dave/public_html/hello.html.
To get this feature enabled, look through the /etc/httpd/conf/httpd.conf
file for a line:
UserDir disable
When you find this line delete it, or put a # infront of it.
Then look on a little further to find:
#UserDir public_html
Delete the '#' comment character from the front of this line. As you have changed
the configuration remember to reload the httpd service!
Now create a user called "dave", create a public_html directory
in dave's home directory, and create a file hello.html in the public_html.
The contents of this file should be:
<html>
<body>
<h1>HOST</h1>
<p>
I am clever
</p>
</body>
</html>
The "/home/dave" and "/home/dave/public_html" must be executable by others, and the "/home/dave/public_html/hello.html"
file must be readable by
other. More generous permissions or permission changes on owner or group from
the default will be marked incorrect.
You can direct your browser to see this page by using the URL
http://yourmachinename/~dave/hello.html
Replace "yourmachinename" with the output of running the "hostname" command, eg
[root@host-19-17 dave]# hostname
host-19-17.linuxzoo.net
Finally, SELinux is enabled in enforcing mode in Fedora 15 by default. This
means you need even more security to overcome (configure). You need to make
sure that the SELinux boolean httpd_read_user_content is enabled. By default
SELinux is forbidden from reading any file in /home. Check with
getsebool httpd_read_user_content
and if needed set it with
setsebool -P httpd_read_user_content 1
"setsebool" may take 20 or more seconds to run. It will finish, honest!