About UserDir

Sep 6, 2007 14:54 GMT  ·  By

If you want to permit your users to have their own websites in their home directory, you can use UserDir directive. The visitors will access their website using for example the following link: http://www.softpedia.com/~webscripts/ . The visitors will go to the home directory of the user webscripts.

The UserDir directive specifies the directory where the content is loaded. The UserDir directive can take the following forms:

- UserDir public_html - the URL http://www.softpedia.com/~webscripts/test.html will be modified to the file path /home/webscripts/public_html/test.html. You can use this when the path does not start with a leading slash.

- UserDir /var/html - the URL http://www.softpedia.com/~webscripts/test.html will be modified to the file path /var/html/webscripts/test.html. Use this when the path starts with a slash.

- UserDir /var/www/*/docs - the URL http://www.softpedia.com/~webscripts/test.html will be translated to the file path /var/www/webscripts/docs/test.html. Use this when the path contains an "*" a path is used in which the asterisk is replaced with the username.

To allow a few users to have UserDir directories, but not anyone else, use the following:

UserDir enabled UserDir disabled softpedia webscripts

To allow most users to have UserDir directories, but deny this to a few, use the following:

UserDir enabled UserDir disabled softpedia webscripts

It is also possible to specify alternative user directories. If you use a command like: Userdir public_html /usr/web http://www.softpedia.com/

Is you want to let users to modify the settings for their webspace, use AllowOverride directive to set the parameters. The default setting is AllowOverride All. AllowOverride is valid only in sections specified without regular expressions, not in , or sections.

Also, if you want to give access for your users to the cgi-bin directory, use directive:

Options ExecCGI SetHandler cgi-script

So, the link of the cgi-bin directory of the user webscripts will be: http://www.softpedia.com/~webscripts/cgi-bin/softpedia.cgi