# This file is for Apache 1.3.x and Apache 2.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 /usr/local/xymon/server/www/

Alias /xymon/  "/usr/local/xymon/server/www/"
<Directory "/usr/local/xymon/server/www/">
    Options Indexes FollowSymLinks Includes MultiViews
    <IfModule mod_authz_core.c>
        # Apache 2.4+
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Allow from all
    </IfModule>
</Directory>

ScriptAlias /xymon-cgi/ "/usr/local/xymon/cgi-bin/"
<Directory "/usr/local/xymon/cgi-bin">
    AllowOverride None
    Options ExecCGI Includes
    <IfModule mod_authz_core.c>
        # Apache 2.4+
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Allow from all
    </IfModule>
</Directory>

ScriptAlias /xymon-seccgi/ "/usr/local/xymon/cgi-secure/"
<Directory "/usr/local/xymon/cgi-secure">
    AllowOverride None
    Options ExecCGI Includes
    <IfModule mod_authz_core.c>
        # Apache 2.4+
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Allow from all
    </IfModule>

    # Password file where users with access to these scripts are kept.
    # Create it with "htpasswd -c /usr/local/xymon/server/etc/xymonpasswd USERNAME"
    # Add more users / change passwords with "htpasswd /usr/local/xymon/server/etc/xymonpasswd USERNAME"

    AuthUserFile /usr/local/xymon/server/etc/xymonpasswd
    AuthType Basic
    AuthName "Xymon Administration"
    Require valid-user
</Directory>

