Softpedia
 

NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home > News > Webmaster > Tips and Tricks

September 6th, 2007, 14:54 GMT · By Adrian Placinta

Create Directories for Every User in Apache

SHARE:

Adjust text size:



Enlarge picture
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
FILED UNDER:
UserDir
Apache
Windows

TELL US WHAT YOU THINK:

2,889 hits · Link to this article · Print article · Send to friend · Subscribe to news

MUST-READ RELATED ARTICLES:


Monitoring a Linux System with X11/Console/Web-Based Tools

Apache service and command prompt

Install mod_perl for Apache 2

Install Zend Optimizer

READER COMMENTS:



No user comments yet.
Be the first to express your opinion!
Copyright © 2001-2012 Softpedia. Contact/Tip us at

WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM