# This file is for Apache 1.3.x and Apache 2.0.x
#
# Add this to your Apache configuration, it makes
# the Xymon webpages and cgi-scripts available in the
# "/xymon" and "/xymon-cgi" URLs.


# NB: The "Alias" line below must NOT be used if you have
#     the Xymon webfiles as the root URL. In that case,
#     you should instead set this:
#
#          DocumentRoot /var/lib/xymon/www

Alias /xymon/  "/var/lib/xymon/www/"
<Directory "/var/lib/xymon/www">
    Options Indexes FollowSymLinks Includes MultiViews
    Order allow,deny
    Allow from localhost ::1/128
</Directory>

ScriptAlias /xymon-cgi/ "/usr/lib/xymon/cgi-bin/"
<Directory "/usr/lib/xymon/cgi-bin">
    AllowOverride None
    Options ExecCGI Includes
    Order allow,deny
    Allow from localhost ::1/128
</Directory>

ScriptAlias /xymon-seccgi/ "/usr/lib/xymon/cgi-secure/"
<Directory "/usr/lib/xymon/cgi-secure">
    AllowOverride None
    Options ExecCGI Includes
    Order allow,deny
    Allow from localhost ::1/128

    # Password file where users with access to these scripts are kept.
    # Create it with "htpasswd -c /etc/xymon/xymonpasswd USERNAME"
    # Add more users / change passwords with "htpasswd /etc/xymon/xymonpasswd USERNAME"
    #
    # You can also use a group file to restrict admin access to members of a
    # group, instead of anyone who is logged in. In that case you must setup
    # the "xymongroups" file, and change the "Require" settings to require
    # a specific group membership. See the Apache docs for more details.

    AuthUserFile /etc/xymon/xymonpasswd
    AuthGroupFile /etc/xymon/xymongroups
    AuthType Basic
    AuthName "Xymon Administration"

    # "valid-user" restricts access to anyone who is logged in.
    Require valid-user

    # "group admins" restricts access to users who have logged in, AND
    # are members of the "admins" group in xymongroups.
    # Require group admins

</Directory>

# Rewrite-rules for migrating from the URL's used in Hobbit
RewriteEngine On

RewriteRule ^/xymon/bb.html /xymon/xymon.html [R=permanent,L]
RewriteRule ^/xymon/bb2.html /xymon/nongreen.html [R=permanent,L]
RewriteRule ^/xymon/bbnk.html /xymon/critical.html [R=permanent,L]

RewriteRule ^/xymon-cgi/bb-hist.sh /xymon-cgi/history.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/bb-eventlog.sh /xymon-cgi/eventlog.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/bb-rep.sh /xymon-cgi/report.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/bb-replog.sh /xymon-cgi/reportlog.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/bb-snapshot.sh /xymon-cgi/snapshot.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/bb-findhost.sh /xymon-cgi/findhost.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/bb-csvinfo.sh /xymon-cgi/csvinfo.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbitcolumn.sh /xymon-cgi/columndoc.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/bb-datepage.sh /xymon-cgi/datepage.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbitgraph.sh /xymon-cgi/showgraph.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/bb-hostsvc.sh /xymon-cgi/svcstatus.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/bb-histlog.sh /xymon-cgi/historylog.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-confreport.sh /xymon-cgi/confreport.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-confreport-critical.sh /xymon-cgi/confreport-critical.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-nkview.sh /xymon-cgi/criticalview.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-certreport.sh /xymon-cgi/certreport.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-nongreen.sh /xymon-cgi/nongreen.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-hostgraphs.sh /xymon-cgi/hostgraphs.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-ghosts.sh /xymon-cgi/ghostlist.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-notifylog.sh /xymon-cgi/notifications.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-hostlist.sh /xymon-cgi/hostlist.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-perfdata.sh /xymon-cgi/perfdata.sh [R=permanent,L]
RewriteRule ^/xymon-cgi/hobbit-topchanges.sh /xymon-cgi/topchanges.sh [R=permanent,L]

RewriteRule ^/xymon-seccgi/bb-ack.sh /xymon-seccgi/acknowledge.sh [R=permanent,L]
RewriteRule ^/xymon-seccgi/hobbit-enadis.sh /xymon-seccgi/enadis.sh [R=permanent,L]
RewriteRule ^/xymon-seccgi/hobbit-nkedit.sh /xymon-seccgi/criticaleditor.sh [R=permanent,L]
RewriteRule ^/xymon-seccgi/hobbit-ackinfo.sh /xymon-seccgi/ackinfo.sh [R=permanent,L]
RewriteRule ^/xymon-seccgi/hobbit-useradm.sh /xymon-seccgi/useradm.sh [R=permanent,L]

