Module mod_userdir

Important: Information for this topic supports the latest PTF levels for HTTP Server for i5/OS . It is recommended that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm Link outside Information Center for more information.

Summary

The module mod_userdir provides for user-specific directories.

Directive

UserDir

Module: mod_userdir
Syntax: UserDir directory [directory ...] | enabled username [username ...] | disabled [username...]
Default: UserDir public_html
Context: server config, virtual host
Override: mod_userdir
Origin: Apache
Example: UserDir WWW
Example: UserDir enable lewis thomas
Example: UserDir disable sherman fazio
Example: UserDir disable

The UserDir directive sets the real directory in a user's home directory to use when a request for a document for a user is received. The user's home directory is based on the HOMEDIR setting of the user's iSeries™ user profile. Directory is one of the following:

Parameter: directory
  • The name of a directory or a pattern such as those shown below.
  • The keyword disabled. This turns off all username-to-directory translations except those explicitly named with the enabled keyword (see below).
  • The keyword disabled followed by a space-delimited list of usernames. Usernames that appear in such a list will never have directory translation performed, even if they appear in an enabled clause.
  • The keyword enabled followed by a space-delimited list of usernames. These usernames will have directory translation performed even if a global disable is in effect, but not if they also appear in a disabled clause. Note: the keyword enabled without a list of usernames is not valid.
Note: The UserDir directive is not inherited by virtual hosts when it is set in the global server configuration.

If neither the enabled nor the disabled keywords appear in the UserDir directive, the argument is treated as a filename pattern (or list of filename patterns), and is used to turn the name into a directory specification. For example, assume that the HOMEDIR parameter of the iSeries user profile "bob" is set to /home/bob. A request for http://www.QIBM.com/~bob/one/two.html will be translated to:

UserDir public_html -> /home/bob/public_html/one/two.html 
UserDir /usr/web -> /usr/web/bob/one/two.html 
UserDir /home/*/www -> /home/bob/www/one/two.html

The following directives will send redirects to the client:

UserDir http://www.QIBM.com/users -> http://www.QIBM.com/users/home/bob/one/two.html 
UserDir http://www.QIBM.com/*/usr -> http://www.QIBM.com/home/bob/usr/one/two.html
Note: Use caution when using this directive; for instance, "UserDir ./" would map "/~root" to "/" - which is most likely undesirable. It is strongly recommended that your configuration include a "UserDir disabled root" declaration. If multiple UserDir directives without disable or enable keywords occur in a configuration, the last one is used.

See <Directory> and Security tips for HTTP Server for more information.