Enabling Per-user Pages


UserDir enabled UserDir public_html


Have you ever accessed an URL similar to http://www.example.com/~joe?

That is what is called a per-user web page. Each user in the system is assigned a URL that starts with ~ and the name of the user. When Apache finds such a request, it maps it to a special path inside the user's home directory. This functionality allows each one of your users to publish their own content. This functionality is provided by mod_userdir. You can enable and disable this functionality with the UserDir enabled and UserDir disabled configuration directives. You can also specify an additional list of usernames to selectively enable or disable, as in UserDir disabled mysql root.

If the first argument is not enabled or disabled, it is used to specify where per-user websites are stored. For example, UserDir public_html will map a request for http://www.example.com/~user/ to /home/user/public_html/. The path itself can also contain a pattern, such as

UserDir /home/*/web


which will map http://www.example.com/~user/index.thml to

/home/user/web/index.html


The per-user directories need to be readable by the user Apache runs as. Finally, you can choose to redirect the client to a certain URL. For example

UserDir http://www.example.com


will map http://www.example.com/~user/index.thml to http://www.example/user/index.html.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net