# This file is for Apache 2.4 and later.
#
# It is generated at configure/build time from xymon-apacheconf.txt.DIST
# with the install paths and URLs substituted in. The authoritative copy of this
# Apache configuration is also produced as xymon-apache.conf during
# installation; either file can be used.

ScriptAlias /xymon-cgi/ "/usr/lib/xymon/cgi-bin/"
<Directory "/usr/lib/xymon/cgi-bin">
    AllowOverride None
    Options ExecCGI Includes
    Require all granted
</Directory>

ScriptAlias /xymon-seccgi/ "/usr/lib/xymon/cgi-secure/"
<Directory "/usr/lib/xymon/cgi-secure">
    AllowOverride None
    Options ExecCGI Includes

    # NB: Do NOT add "Require all granted" here. In Apache 2.4 multiple
    # Require directives at the same level are combined with an implicit
    # <RequireAny>, so "Require all granted" would satisfy access on its
    # own and bypass the authentication enforced below.

    # 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

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

# The web pages come after the CGI directories: Apache uses the first alias
# that matches, and with the web pages at the root URL ("/" to configure)
# this one matches every URL. The build writes a plain Alias for the
# configured URL, which Apache takes literally, with the trailing slashes
# Apache needs at the root.
Alias /xymon "/var/lib/xymon/www"
<Directory "/var/lib/xymon/www/">
    Options Indexes FollowSymLinks Includes MultiViews
    Require all granted
</Directory>
