Nagios、webmin 和 apache2

Nagios、webmin 和 apache2

我正在尝试在 webmin 上配置 nagios。我已经按照教程操作了,但它仍然不起作用,我的意思是当我转到 web1.example.com/nagios 时什么都没有显示,似乎没有指向 /usr/local/nagios/share 文件夹的链接。我在想它可能需要设置虚拟主机文件,但当我添加虚拟主机时,它显示重新启动 apache2.service

十月 27 11:22:36 nagios.monster-it.uk apachectl[24761]: (2)没有此文件或目录:AH02291:无法访问目录“/var/log/httpd/”以获取在 /etc/apache2/sites-enabled/nagios.conf:1 定义的 vhost 的错误日志 十月 27 11:22:36 nagios.monster-it.uk apachectl[24761]: AH00014:配置检查失败 十月 27 11:22:36 nagios.monster-it.uk apachectl[24761]: 操作“graceful”失败。十月 27 11:22:36 nagios.monster-it.uk apachectl[24761]: Apache 错误日志可能有更多信息。

。它为 Apache 提供了一个模板配置文件,但我需要创建一个虚拟主机文件,但不确定如何去做。

<VirtualHost *:80>
ServerName nagios.monster-it.uk
ServerAlias nagios
ServerAdmin [email protected]
DocumentRoot /usr/local/nagios/share

ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin
ScriptAlias /cgi-bin /usr/local/nagios/sbin
Alias /nagios  /usr/local/nagios/share

<Directory /usr/local/nagios/share>
        Options Indexes FollowSymLinks MultiViews
        #  SSLRequireSSL
        AllowOverride None
        Order allow,deny
        Allow from all
        #  Order deny,allow
        #  Deny from all
        #  Allow from 127.0.0.1
        AuthName "Nagios Access"
        AuthType Basic
        AuthUserFile /usr/local/nagios/etc/htpasswd.users
        Require valid-user
</Directory>

<Directory "/usr/local/nagios/sbin">
        #  SSLRequireSSL
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        AllowOverride None
        Order allow,deny
        Allow from all
        #  Order deny,allow
        #  Deny from all
        #  Allow from 127.0.0.1
        AuthName "Nagios Access"
        AuthType Basic
        AuthUserFile /usr/local/nagios/etc/htpasswd.users
        Require valid-user
</Directory>

ErrorLog /var/log/httpd/nagios_error.log

LogLevel warn

CustomLog /var/log/httpd/nagios_access.log combined
ServerSignature On
</VirtualHost>

APACHE WEB 服务器的配置片段示例 此文件包含需要合并到 Apache WEB 服务器配置文件中的条目示例。根据需要自定义路径等以适合您的系统。

ScriptAlias /nagios/cgi-bin “/usr/local/nagios/sbin”

<目录“/usr/local/nagios/sbin”> SSLRequireSSL 选项 ExecCGI AllowOverride None = 2.3> 要求全部授予 要求主机 127.0.0.1

     AuthName "Nagios Access"
     AuthType Basic
     AuthUserFile /usr/local/nagios/etc/htpasswd.users
     Require valid-user
  </RequireAll>
命令允许、拒绝 允许所有 命令拒绝、允许 所有拒绝 允许来自 127.0.0.1
  AuthName "Nagios Access"
  AuthType Basic
  AuthUserFile /usr/local/nagios/etc/htpasswd.users
  Require valid-user
别名 /nagios “/usr/local/nagios/share”

<目录“/usr/local/nagios/share”> SSLRequireSSL 选项 None AllowOverride None = 2.3> 要求全部授予 要求主机 127.0.0.1

     AuthName "Nagios Access"
     AuthType Basic
     AuthUserFile /usr/local/nagios/etc/htpasswd.users
     Require valid-user
  </RequireAll>
命令允许、拒绝 允许所有 命令拒绝、允许 所有拒绝 允许来自 127.0.0.1
  AuthName "Nagios Access"
  AuthType Basic
  AuthUserFile /usr/local/nagios/etc/htpasswd.users
  Require valid-user

相关内容