Score:0

Nagios, webmin and apache2

tc flag

I'm trying to configure nagios on webmin. I've ran through the tutorial but its still not working by that i mean when i goto web1.example.com/nagios is shows nothing, there doesn't seem to be a link to the /usr/local/nagios/share folder. I was thinking it's maybe needs a virtual host file setup but when i add the virtual host is says on restarting apache2.service

Oct 27 11:22:36 nagios.monster-it.uk apachectl[24761]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/httpd/' for error log of vhost defined at /etc/apache2/sites-enabled/nagios.conf:1 Oct 27 11:22:36 nagios.monster-it.uk apachectl[24761]: AH00014: Configuration check failed Oct 27 11:22:36 nagios.monster-it.uk apachectl[24761]: Action 'graceful' failed. Oct 27 11:22:36 nagios.monster-it.uk apachectl[24761]: The Apache error log may have more information.

. It's given a template conf file for Apache but I need to make a virtualhost file but not sure how to go about it.

<VirtualHost *:80>
ServerName nagios.monster-it.uk
ServerAlias nagios
ServerAdmin webmaster@example.org
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>

SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER This file contains examples of entries that need to be incorporated into your Apache web server configuration file. Customize the paths, etc. as needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin"> SSLRequireSSL Options ExecCGI AllowOverride None = 2.3> Require all granted Require host 127.0.0.1

     AuthName "Nagios Access"
     AuthType Basic
     AuthUserFile /usr/local/nagios/etc/htpasswd.users
     Require valid-user
  </RequireAll>
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
Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share"> SSLRequireSSL Options None AllowOverride None = 2.3> Require all granted Require host 127.0.0.1

     AuthName "Nagios Access"
     AuthType Basic
     AuthUserFile /usr/local/nagios/etc/htpasswd.users
     Require valid-user
  </RequireAll>
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
in flag
Welcome to AskUbuntu! Could you elaborate on "Not working"? What do you mean by this? Does the server return any data or are you getting a 500 error? Have you checked the logs in `/var/log/apache2` to see whether there is a message describing a configuration error or permissions issue?
Alex Tovey avatar
tc flag
I'm getting this in the error log. [Wed Oct 26 09:31:36.651146 2022] [mpm_event:notice] [pid 1889:tid 140477850631104] AH00493: SIGUSR1 received. Doing graceful restart 'AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using nagios.monster-it.uk. Set the 'ServerName' directive globally to suppress this message'
in flag
That's just a notice, not an error. You would have likely seen something similar when issuing a `sudo service apache2 restart`. Could you explain what you mean by "not working", though? When it comes to websites, this can be interpreted 100 different ways ...
Alex Tovey avatar
tc flag
Okay, I've cleared the log fault with apache, but not when I visit the site with /nagios it comes up with 404 not found.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.