Require User Authentication for Report Directory

Usage: Setting up username and password authentication for a customer's report directory.

This sets up a requirement on an Apache directory and could technically be set up for any directory that is served by Apache.

On IPREV2 edit the Apache configuration file:

As root edit the following file: /usr/local/apache/conf/httpd.conf

Note: It is a good idea to make a backup copy of this file before editing the original.

Add an Apache directive to handle the authentication for this directory. This can be placed anywhere in the file but for improved maintainability place it with the other Directory directive for other customers.

The directive should be of this form.

# Directory entry added by Eric Chambers 2006-07-20
<Directory "/cdrive/web/netwatch/html/data/cabelas">
        AuthType Basic
        AuthName "Cabelas XML access"
        AuthUserFile /usr/local/apache/conf/htpasswd_xml_data_dir
        Require user cabelasonline

Change the Directory and AuthName lines relevant to the customer being added.

The Require user line is the usrname to be used for that directory.

The AuthUserFile line refers to the location of the password file for Apache.

Use the following command to append a new username and password to the Auth file.

/usr/local/apache/bin/htpasswd /usr/local/apache/conf/htpasswd_xml_data_dir cabelasonline

You will be prompted for a password for the username specified (cabelasonline is the username in the above example) and then prompted again to confirm the password.

Restart Apache in order for the changes to take affect.

# service httpd restart

Require User Authentication for Report Directory (last edited 2006-07-20 20:14:24 by Eric)