# 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/lib/xymon/server/www/

Alias /xymon  "/usr/lib/xymon/server/www"
<Directory "/usr/lib/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/lib/xymon/cgi-bin"
<Directory "/usr/lib/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/lib/xymon/cgi-secure"
<Directory "/usr/lib/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>

