Desc: NUT HTML complementary information
File: README
Date: 27 Jul 2005
Auth: Arnaud Quette <arnaud.quette@free.fr>
      Dave Breiland <superdave@dynamicis.com>

This file provides some complementary information
about the use and integration of NUT HTML pages.

1) Introduction
---------------

NUT HTML pages have been created as a central point
that ease the access to the various CGI scripts
providing the NUT web interface.

It consists of three .html files:
- index.html: defines the two container frames,
topFrame and mainFrame
- header.html: contain the header including links
to NUT website, and upsstat.cgi/upsset.cgi
- bottom.html: empty frame that will be replaced
with the content of upsstat.cgi or upsset.cgi.

2) Integration
--------------

You first need to install NUT CGI (ie using ./configure --with-cgi).
Refer to the README file for more information

There are two ways to integrate NUT HTML with your
webserver, with the same results:

a) take advantage of the existing tree
======================================

- the cgi are for example installed in /usr/lib/cgi-bin,
which is already  configured in your webserver as the
default CGI path

- in the same spirit, we will use the existing DocumentRoot
and create a "nut" subdirectory, and copy the three .html
files (index, header and bottom)

Note that the links to cgi scripts in header.html are
pre configured to work in this situation, which ease
the packagers work.

b) configure manually
=====================

- copy the data/html directory to somepath (ie /usr/local/nut
for a standard installation from source)

-Now edit your webserver configuration file, adding for
example (for Apache):

#Begin Section
ScriptAlias /nut/cgi-bin/ /usr/local/nut/cgi-bin/
<Directory "/usr/local/nut/cgi-bin/">
    AllowOverride AuthConfig
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>

Alias /nut/ /usr/local/nut/html/
<Directory "/usr/local/nut/html/">
    Options None
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all
</Directory>
#End Section

-Make sure to change the links path in header.html according to your
configuration and installation.

3) Conclusion
=============

- Make sure to restart your webserver.

-Configure the CGI scripts.  Manpages can be found from:
--prompt> man -M /usr/local/nut/man/ upsstats.cgi
--prompt> man -M /usr/local/nut/man/ upsset.cgi
--prompt> man -M /usr/local/nut/man/ upsimage.cgi
--prompt> man -M /usr/local/nut/man/ hosts.conf

-It is recommended that you use .htaccess files in the cgi-bin folder and the
html folder.  Please reference:
http://httpd.apache.org/docs/howto/htaccess.html

- You will then be able to access the NUT HTML page at:
http://localhost/nut


