Fork 0

51 lines
1.9 KiB

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:lighttpd.net:lighttpd2/doc1">
<short>allows you to have user-specific document roots being accessed through http://domain/~user/</short>
The document root can be built by using the home directory of a user which is specified by /~username/ at the beginning of the request path.
Alternatively, mod_userdir can build the docroot from a pattern similar to @vhost.pattern@ but using the username instead of the hostname.
<action name="userdir">
<short>builds the document root by replacing certain placeholders in path with (parts of) the username.</short>
<parameter name="path">
<short>the path to build the document root with</short>
If @path@ does not start with a slash (/), then the document root is prepended with the home directory of the given user as specified in /etc/passwd.
Otherwise the @path@ specifies the absolute docroot to be used.
Placeholders are:
* @*@ replaced by the complete username
* $1-9 replaced by the n-th letter of the username, e.g. $2 is the second letter
Request for http://host/~lighty/foo.html (assuming "/home/lighty" is the home of the "lighty" user):
table(table table-striped).
|_. @path@ |_. docroot |_. physicalpath|
| "public_html" | /home/lighty/public_html/ | /home/lighty/public_html/foo.html |
| "/usr/web/*/" | /usr/web/lighty/ | /usr/web/lighty/foo.html |
| "/usr/web" | /usr/web/lighty/ | /usr/web/lighty/foo.html |
| "/www/users/$1/$1$2/*/" | /www/users/l/li/lighty/ | /www/users/l/li/lighty/foo.html |
*Note*: username "root" is not allowed for security reasons.
setup {
module_load "mod_userdir";
userdir "public_html";