Running another web site on same server as nagios

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
paulfoel
Posts: 6
Joined: Wed Nov 01, 2017 4:05 am

Running another web site on same server as nagios

Post 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.
Last edited by paulfoel on Mon Nov 13, 2017 5:33 am, edited 1 time in total.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Changing Nagios web front end "hostname"?

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
paulfoel
Posts: 6
Joined: Wed Nov 01, 2017 4:05 am

Re: Changing Nagios web front end "hostname"?

Post 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.
paulfoel
Posts: 6
Joined: Wed Nov 01, 2017 4:05 am

Re: Changing Nagios web front end "hostname"?

Post by paulfoel »

Sorry I dont think thats right....

There are many directories under /usr/local/
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Changing Nagios web front end "hostname"?

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
paulfoel
Posts: 6
Joined: Wed Nov 01, 2017 4:05 am

Re: Changing Nagios web front end "hostname"?

Post 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.
paulfoel
Posts: 6
Joined: Wed Nov 01, 2017 4:05 am

Re: Running another web site on same server as nagios

Post 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!)
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Running another web site on same server as nagios

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
paulfoel
Posts: 6
Joined: Wed Nov 01, 2017 4:05 am

Re: Running another web site on same server as nagios

Post 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.
kyang

Re: Running another web site on same server as nagios

Post 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?
Locked