Per-user web directories

On systems with multiple users, each user can be permitted to have a
web site in their home directory using the UserDir directive. Visitors
to a URL http://example.com/~username/ will get content
out of the home directory of the user "username", out of
the subdirectory specified by the UserDir directive.

Note that, by default, access to these directories is not
enabled. You can enable access when using UserDir by uncommenting the line

#Include conf/extra/httpd-userdir.conf

in the default config file conf/httpd.conf, and adapting the httpd-userdir.conf
file as necessary, or by including the appropriate directives in a
Directory block within the main config file.

See also

The UserDir
directive specifies a directory out of which per-user
content is loaded. This directive may take several different forms.

If a path is given which does not start with a leading slash, it is
assumed to be a directory path relative to the home directory of the
specified user. Given this configuration:

UserDir public_html

the URL http://example.com/~rbowen/file.html will be
translated to the file path
/home/rbowen/public_html/file.html

If a path is given starting with a slash, a directory path will be
constructed using that path, plus the username specified. Given this
configuration:

UserDir /var/html

the URL http://example.com/~rbowen/file.html will be
translated to the file path /var/html/rbowen/file.html

If a path is provided which contains an asterisk (*), a path is used
in which the asterisk is replaced with the username. Given this
configuration:

UserDir /var/www/*/docs

the URL http://example.com/~rbowen/file.html will be
translated to the file path
/var/www/rbowen/docs/file.html

Multiple directories or directory paths can also be set.

UserDir public_html /var/html

For the URL http://example.com/~rbowen/file.html,
Apache will search for ~rbowen. If it isn't found,
Apache will search for rbowen in /var/html. If
found, the above URL will then be translated to the file path
/var/html/rbowen/file.html

Using the syntax shown in the UserDir documentation, you can restrict
what users are permitted to use this functionality:

UserDir disabled root jro fish

The configuration above will enable the feature for all users
except for those listed in the disabled statement.
You can, likewise, disable the feature for all but a few users by
using a configuration like the following:

If you want to allows users to modify the server configuration in
their web space, they will need to use .htaccess files to
make these changes. Ensure that you have set AllowOverride to a
value sufficient for the directives that you want to permit the users
to modify. See the .htaccess tutorial for
additional details on how this works.

Notice:This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.