Contact Us | Products/Services | Korn Shell | MicroEMACS


AIXtm mtXIA :
Technical Consulting Group
kshAuth - Authentication and Authorization System for Apache Web Server

 

Change Top Dir


Current:Change Top Dir
Previous:kshAuth
Home Page

kshAuth
Installation
Tutorial
Look and Feel

kshAuth - Authentication and Authorization Interface for Apache 2.2+ Web Server

Version 0.2


Instructions to Change Top Level kshAuth Directory

Instructions for changing the top level directory used as the authorization structure to something other than "kshAuth".

To use "kshAuth" you MUST use at least one directory level below the apache "htdocs" directory as your structure. This document assumes the following Apache directory structures:

  • /usr/local/apache2: Top level Apache 2.2+ prefix
  • /usr/local/apache2/cgi-bin: The location of the CGI directory
  • /usr/local/apache2/htdocs: The Apache 2.2+ document directory
  • /usr/local/apache2/cgi-bin/kshAuth: Default location for the kshAuth CGI programs
  • /usr/local/apache2/htdocs/kshAuth: Default location for the kshAuth document directory
  • /usr/local/apache2/kshAuth: Default location for the kshAuth Authentication files

Under this Apache structure, a sub-directory named "css" will be used as an example for changing the top level kshAuth from "kshAuth" to "css".

Create the "CGI" program directory for the new "css" structure:

mkdir /usr/local/apache2/cgi-bin/css

Create the document directory for the new "css" structure (this probably already exists on your system since this is what you are changing kshAuth to use, but if not...) :

mkdir /usr/local/apache2/htdocs/css

Create the authorization structure directory to contain the password files and such:

mkdir /usr/local/apache2/css

Copy the "kshAuth" files from their default locations to these new directories:

cp  /usr/local/apache2/cgi-bin/kshAuth/*   /usr/local/apache2/cgi-bin/css
cp  /usr/local/apache2/kshAuth/.[a-zA-Z]*  /usr/local/apache2/css

Edit all CGI files and change "/kshAuth/" to "/css/":

cd /usr/local/apache2/cgi-bin/css

for FILE in *
do
    echo "${FILE}"
    sed -e "s|/kshAuth/|/css/|g" < "${FILE}" > /tmp/tmp${$}.out
    mv /tmp/tmp${$}.out "${FILE}"
done

If you also wish to copy the kshAuth document directory files (not required or necessary), then do the following:

cp -Rp /usr/local/apache2/htdocs/kshAuth/*   /usr/local/apache2/htdocs/css
cd /usr/local/apache2/htdocs/css
for FILE in $( find . -type f -exec grep -l '/kshAuth/' {} \; )
do
    echo "${FILE}"
    sed -e "s|/kshAuth/|/css/|g" < "${FILE}" > /tmp/tmp${$}.out
    mv /tmp/tmp${$}.out "${FILE}"
done

When file copying and editing is complete, then change the ownership and group membership of all files to the apache web server owner and group specified in the http.conf file. The following examples assume the owner and group is daemon and daemon:

chmod 755 /usr/local/apache2/cgi-bin/css/*
chmod 600 /usr/local/apache2/css/.[a-zA-Z]*
chown -R daemon:daemon /usr/local/apache2/cgi-bin/css
chown -R daemon:daemon /usr/local/apache2/htdocs/css
chown -R daemon:daemon /usr/local/apache2/css

 

For information regarding this page, contact Dana French ( dfrench@mtxia.com )