Page 1 of 1

Running another web site on same server as nagios

Posted: Wed Nov 01, 2017 4:51 am
by paulfoel
Nagios XI installed on Red Hat Server.

At the moment, we access Nagios using http://"actual server name"

Which wouldn't be a problem but we want to run another web app (something called Netbox) on the same server. Looking at httpd.conf I can see no entries for Nagios. But I am able to add a virtual host using port 8080 for my netbox app and it works ok (albeit via http://"server name":8080).

Ideally, what I'd like to do (and using dns obviously) is be able to access nagios at http://nagios and netbox at http:/netbox. Both on port 80.

Normally I could do this using two virtual servers in httpd.conf but nagios seems not to do it that way.

Re: Changing Nagios web front end "hostname"?

Posted: Wed Nov 01, 2017 12:22 pm
by npolovenko
Hello, @paulfoel.
If you go to /usr/local/ you'll see the folder called nagiosxi. That folder corresponds to your http://actualservername/nagiosxi .So technically all you need to do is put netbox folder with html files to /usr/local/ .After that please run service httpd restart. Now you should be able to access http://actualservername/netbox and it'll run on port 80 by default.

Re: Changing Nagios web front end "hostname"?

Posted: Thu Nov 02, 2017 3:37 am
by paulfoel
npolovenko wrote:Hello, @paulfoel.
If you go to /usr/local/ you'll see the folder called nagiosxi. That folder corresponds to your http://actualservername/nagiosxi .So technically all you need to do is put netbox folder with html files to /usr/local/ .After that please run service httpd restart. Now you should be able to access http://actualservername/netbox and it'll run on port 80 by default.
Thanks. I'll take a look.

Before I installed http://server1 worked for nagios though? (And still does). Not http://server1/nagiosxi.

Re: Changing Nagios web front end "hostname"?

Posted: Thu Nov 02, 2017 4:33 am
by paulfoel
Sorry I dont think thats right....

There are many directories under /usr/local/

Re: Changing Nagios web front end "hostname"?

Posted: Thu Nov 02, 2017 11:59 am
by npolovenko
@paulfoel, Yes, I completely forgot about creating apache path configuration :roll: .

1. navigate to /etc/httpd/conf.d/ folder
2. create a new configuration file, for example, netbox.conf
3. inside the file paste this:

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# 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.


Alias /netbox "/usr/local/netbox"

<Directory "/usr/local/netbox/">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Core"
   AuthType Basic
   AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
   Require valid-user
   Require all denied
</Directory>

After you create the conf file, please run

Code: Select all

service nagios restart
service httpd restart
Let us know if that worked for you.

Re: Changing Nagios web front end "hostname"?

Posted: Mon Nov 13, 2017 5:30 am
by paulfoel
Nope. Why would I reference nagios in a netbox.conf file?

I have the apache config I need for netbox its just getting it working with nagios.

Re: Running another web site on same server as nagios

Posted: Mon Nov 13, 2017 6:14 am
by paulfoel
BTW - even if I add netbox.conf into the conf.d directory and enter virtualhost details there it not defaults to the netbox stuff.

Only way to get it work at moment is to set netbox to use port 8080. It seems any virtual host entry I add on port 80 overwrites any nagios on the same port (Although I cant even see how nagios works on apache!)

Re: Running another web site on same server as nagios

Posted: Mon Nov 13, 2017 4:39 pm
by npolovenko
Hi, @paulfoel.
Nope. Why would I reference nagios in a netbox.conf file?

Code: Select all

Alias /netbox "/usr/local/netbox"

<Directory "/usr/local/netbox/">
Satisfy Any
Allow from all

</Directory>
Ok, now I see. I'm not familiar with NetBox but based on what you've said it uses Its own Apache configuration, not just a path. In this case, we do not recommend/support installing it on the same server with Nagios to avoid performance/compatibility issues.

Re: Running another web site on same server as nagios

Posted: Tue Nov 14, 2017 5:49 am
by paulfoel
OK thanks. If you're interested the only way I could get the netbox app working was to use a different port 8080 with apache.

Re: Running another web site on same server as nagios

Posted: Tue Nov 14, 2017 1:28 pm
by kyang
Thank you. This sounds like it is resolved?

Can I go ahead and lock this thread or did you have any more questions?