gentoo 上缺少 icinga2 安装文档

gentoo 上缺少 icinga2 安装文档

我需要在 gentoo 上安装 mariadb、apache2、php、icinga2 和 icingaweb2。

根据文档,我成功安装了 mariadb、apache2、(可能)php 和 icinga2

目前(根据​​日志)icinga2 运行没有错误。但是,我无法正确配置 icingaweb2。

有没有关于如何在gentoo中配置icingaweb2的文档/教程?

此时,我只需要在端口 80 上进行基本的 HTTP 设置,无需 LDAP。(稍后我将使用 ssl 安全性和域......)

从这个文档中不清楚我在哪里犯了错误

https://icinga.com/docs/icingaweb2/latest/doc/02-Installation/

https://icinga.com/docs/icinga2/latest/doc/02-installation/

https://www.cs.uni-potsdam.de/~pveber/apache.html

目前仅http://localhost响应(默认 apache 消息“It Works!”)

http://localhost/icingaweb2,http://icingaweb2/icingacli,http://icingaweb2/setup等等...什么都没有

我不知道icingaweb2文档根目录必须放在哪里,是在/var/www/还是在/usr/share/icingaweb2/public/

在我的 /etc/apache2/vhosts.d/00_default_vhost.conf 中是:

##mmtest
<Directory "/usr/share/icingaweb2/public">
    Options SymLinksIfOwnerMatch
    AllowOverride None

    DirectoryIndex index.php

    <IfModule mod_authz_core.c>
        # Apache 2.4
        <RequireAll>
            Require all granted
        </RequireAll>
    </IfModule>

    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order allow,deny
        Allow from all
    </IfModule>

    SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb2"

    EnableSendfile Off

    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteBase /icingaweb2/
        RewriteCond %{REQUEST_FILENAME} -s [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    </IfModule>

    <IfModule !mod_rewrite.c>
        DirectoryIndex error_norewrite.html
        ErrorDocument 404 /icingaweb2/error_norewrite.html
    </IfModule>





# Remove comments if you want to use PHP FPM and your Apache version
# is greater than or equal to 2.4
#    <IfVersion >= 2.4>
#        # Forward PHP requests to FPM
#        SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
#        <FilesMatch "\.php$">
#            SetHandler "proxy:fcgi://127.0.0.1:9000"
#            ErrorDocument 503 {urlPath}/error_unavailable.html
#        </FilesMatch>
#    </IfVersion>
</Directory>

答案1

进入 /etc/apache2/vhosts.d/default_vhost.include 我必须放置行

Include /etc/apache2/vhosts.d/99_icingaweb2.include

该行位于文件末尾。在最后一个现有标签之后。

在99_icingaweb2.include中是:

Alias /icingaweb2 /usr/share/icingaweb2/public

<Directory "/usr/share/icingaweb2/public">
    Options SymLinksIfOwnerMatch
    AllowOverride None

    DirectoryIndex index.php

    <IfModule mod_authz_core.c>
        # Apache 2.4
        <RequireAll>
            Require all granted
        </RequireAll>
    </IfModule>

    SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb2"

    EnableSendfile Off

    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteBase /icingaweb2/
        RewriteCond %{REQUEST_FILENAME} -s [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    </IfModule>

    <IfModule !mod_rewrite.c>
        DirectoryIndex error_norewrite.html
        ErrorDocument 404 /icingaweb2/error_norewrite.html
    </IfModule>

# Remove comments if you want to use PHP FPM and your Apache version
# is greater than or equal to 2.4
#    <IfVersion >= 2.4>
#        # Forward PHP requests to FPM
#        SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
#        <FilesMatch "\.php$">
#            SetHandler "proxy:fcgi://127.0.0.1:9000"
#            ErrorDocument 503 {urlPath}/error_unavailable.html
#        </FilesMatch>
#    </IfVersion>
</Directory>

相关内容