2.3.178 UserDir
UserDir specifies the location on the server to be disclosed when a web browser issues a request to /~user_name/.
Description
UserDir specifies the directory name of the location on the server to be disclosed when a web browser issues a request to /~user_name/. If you specify disabled, you can specify the users to whom the web content is not disclosed.
Specify a relative path or an absolute path for the directory name.
- directory_name
-
-
When specifying a relative path:
Specify the location when a user who has a user ID on the server is disclosing web content under the user's home directory. When a request to /~user_name/ is issued, home_directory_of_user/directory_name is accessed.
-
When specifying an absolute path:
Specify the location of the user directory. When a request to /~user_name/ is issued, directory_name/user_name is accessed.
-
- disabled
-
Specify the users to whom the web content is not disclosed in response to a request to /~user_name/ issued from a web browser. The directory name to be accessed will not be converted for a request with the specified user name. If a user name is not specified, it is assumed that all users are specified as disabled.
- Important note
-
-
When you specify a directory name in multiple UserDir directives, the later-specified directory name overwrites the earlier-specified directory name.
-
You can use the multiple UserDir directives to specify multiple disabled user name.
-
Syntax
UserDir {directory_name|disabled [user_name [user_name ...]]}
Locations where it can be written
httpsd.conf and <VirtualHost>
Example
- Example 1:
-
UserDir public_html
If the home directory of user1 is /home/user1, /home/user1/public_html/index.html is accessed in response to a request for http://host_name[:port_number]/~user1/index.html.
- Example 2:
-
UserDir /home UserDir disabled user3 UserDir disabled user4 user5
/home/user1/index.html is accessed in response to a request for http://host_name[:port_number]/~user1/index.html. However, user3 cannot access http://host_name[:port_number]/~user3/index.html when making a request for /home/user3/index.html because disabled is specified for user3. This also applies to user4 and user5.
- Example 3:
-
UserDir disabled
All users are specified as disabled.