
American Power Conversion Ethernet MasterSwitch
Secure Outlet Manager
Version: 1.0
Author: Kit Knox - 3/1/1999 <kit@connectnet.com>

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.

------------------------------------------------------------------------

About
-----

APC MasterSwitch
<a href="http://www.apcc.com/english/prods/acsry/mster/">

MasterSwitch is a remote power distribution unit that allows users to
control power to connected devices.

This is a CGI interface that allows you to setup individual usernames and
passwords for each outlet on APC's MasterSwitch.  With APC's interface one
global username and password controls the entire MasterSwitch.  It is often
useful to give users access to only one port in co-location data centers or
when multiple departments are sharing the same masterswitch and you don't
want them to be able to power cycle your machine.  This program eliminates
the need for a MasterSwitch for EACH CUSTOMER.

Installation
------------

Edit masterswitch.c :

Find "CONFFILE" and change this to the path of your configuration file. 
Remember that this should NOT be within a document root, as it contains
CLEAR TEXT PASSWORDS.  Make sure to chmod the conf file 600!

This program requires the cgic CGI library in order to operate.  Prior to
compiling masterswitch, you must compile cgic106.

$ cd cgic106
$ make
$ cd ..
$ make

You should now have a masterswitch.cgi.  Place this along with the files in
html/ into the directory on your webserver where this will reside.

ie:

$ mkdir /home/httpd/htdocs/apc
$ cp masterswitch.conf /home/httpd/htdocs/apc/
$ cp masterswitch.cgi /home/httpd/htdocs/apc/
$ cp html/* /home/httpd/htdocs/apc/

Configuration
-------------

The masterswitch.conf file is a simple text file that defines what username
and password control what outlet.

Format:

<username>:<password>:<outlet #>:<ip address>:<apc username>:<apc password>

The first username and password is what the web user are required to know,
while the apc username and password are what you have configured in your APC
masterswitch.

------------------------------------------------------------------------

CGIC, copyright 1996, 1997, 1998, 1999 by Thomas Boutell and Boutell.Com,
Inc.. Permission is granted to use CGIC in any application, commercial or
noncommercial, at no cost. HOWEVER, this copyright paragraph must appear on
a "credits" page accessible in the public online and offline documentation
of the program. Modified versions of the CGIC library should not be
distributed without the attachment of a clear statement regarding the author
of the modifications, and this notice may in no case be removed.
Modifications may also be submitted to the author for inclusion in the main
CGIC distribution.

