如何使用 apache vHost 运行 icinga?

如何使用 apache vHost 运行 icinga?

我已经在我的 debian squeeze box 上的 icinga 自己的 repos 中安装了 icinga,但是现在我不知道如何更改当前配置:

# apache configuration for icinga

  ScriptAlias /cgi-bin/icinga /usr/lib/cgi-bin/icinga
  ScriptAlias /icinga/cgi-bin /usr/lib/cgi-bin/icinga

# Where the stylesheets (config files) reside
  Alias /icinga/stylesheets /etc/icinga/stylesheets

# Where the HTML pages live
  Alias /icinga /usr/share/icinga/htdocs

    <DirectoryMatch (/usr/share/icinga/htdocs|/usr/lib/cgi-   bin/icinga|/etc/icinga/stylesheets)>
      Options FollowSymLinks

      DirectoryIndex index.html

      AllowOverride AuthConfig
      #Order Deny, Allow
      Deny from all
      #Allow From 10.42.0.0/24

      AuthName "Icinga Access"
      AuthType Basic
      AuthUserFile /etc/icinga/htpasswd.users
      require valid-user
    </DirectoryMatch>

我想在子域 surveillance.mysite.com 下运行 icinga,但我无法使此配置成为有效的 vHost 配置。有谁能告诉我需要更改什么吗?

答案1

也许是因为没有 VirtualHost、ServerName 或 DocumentRoot 指令?

根据您的配置用 IP 替换星号,但星号是标准程序。

# apache configuration for icinga
<VirtualHost *:80>
    ServerName monitoring.mysite.com
    DocumentRoot /usr/share/icinga/htdocs

    ScriptAlias /cgi-bin/icinga /usr/lib/cgi-bin/icinga
    ScriptAlias /icinga/cgi-bin /usr/lib/cgi-bin/icinga

    # Where the stylesheets (config files) reside
    Alias /icinga/stylesheets /etc/icinga/stylesheets

    # Where the HTML pages live
    Alias /icinga /usr/share/icinga/htdocs

    <DirectoryMatch (/usr/share/icinga/htdocs|/usr/lib/cgi-bin/icinga|/etc/icinga/stylesheets)>
        Options FollowSymLinks

        DirectoryIndex index.html

        AllowOverride AuthConfig
        Order Deny, Allow
        #Deny from All
        #Allow From 10.42.0.0/24

        AuthName "Icinga Access"
        AuthType Basic
        AuthUserFile /etc/icinga/htpasswd.users
        Require valid-user
    </DirectoryMatch>
</VirtualHost>

相关内容