Pivotal Knowledge Base

Follow

Enabling public user directories and cgi-bin directories in Apache HTTP Server, vFabric Web Server, and Pivotal Web Server

Enabling public user directories and cgi-bin directories in Apache HTTP Server, vFabric Enterprise Ready Server, and vFabric Web Server (2010978)

Purpose

This article provides information on how to enable user specific public and cgi-bin directories. After enabling, you can access these directories using http://example.com/~user/ and http://example.com/~user/cgi-bin/.

Resolution

You can enable user specific public directories using the mod_userdir module.
 
To enable user specific public directories, open the httpsd.conf using a text editor and add this entry to the file:

LoadModule userdir_module "/path/to/ers/apache2.2/modules/standard/mod_userdir.so"

Note: This module is enabled by default in ERS 4.0.x. You may have to add this entry to the configuration file for Apache HTTP Server 2.0 and 2.2.

After enabling this module, you can specify the user specific directory location using the UserDir directive.
 
This table lists some of the examples:
 
UserDir Directive Translated URL
UserDir public_html http://example.com/~user/
UserDir /usr/web http://example.com/usr/web/user/
UserDir /home/*/www http://example.com/home/user/www

You can also use the UserDir directive to enable or disable public user specific directories.
 
To enable public user specific directories, use:

UserDir enabled
 
To disable public user specific directories, use:
 
UserDir disabled

Example 1

UserDir enabled
UserDir disabled root jro fish

This enables the user specific directories for all users except root , jro , and fish .

Example 2

UserDir disabled
UserDir enabled rbowen krietz

This disables user specific directories for all users except rbowen and krietz .

You can allow users to have their own cgi-bin directory using the Directory directive. For example:

<Directory /home/*/public_hrml/cgi-bin/>
Options ExecCGI
SetHandler cgi-script
</Directory>

Assuming that UserDir is set to public_html, a cgi script can be accessed at:

http://example.com/~user/cgi-bin/example.cgi

Note: Ensure that there are adequate security measures so that a user cannot make the system vulnerable to attacks via a script located in their cgi-bin directory.

Additional Information

For more information, see:

Note: The preceding links were correct as of January 09, 2012. If you find a link is broken, provide feedback and a VMware employee will update the link.

©VMware 2013

Comments

Powered by Zendesk