I have a subdomain forwarding at IP 192.0.2.1 (example.com
)
Lets call it nagios.example.com
Nagios worked at 192.0.2.1/nagios but now it's not working due to a fact that app.example.com took over default apache port (:80)
So how to solve my problem? :)
I have almost default nagios config in httpd vhost except i've added <VirtualHost *:80 > and ServerName.
<VirtualHost *:80>
ServerName nagios.example.com
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
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 /path/file
Require valid-user
</Directory>
Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
# 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 Access"
AuthType Basic
AuthUserFile /path/file
Require valid-user
</Directory>
</VirtualHost>
PS: httpd -t -D DUMP_VHOSTS
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server domain-alias.example (/etc/httpd/conf.d/app.conf:1)
port 80 namevhost domain-alias.example (/etc/httpd/conf.d/app.conf:1)
port 80 namevhost nagios.example.com (/etc/httpd/conf.d/nagios.conf:8)
Syntax OK
Sorry for "domain-alias.example" but it's kind of private information :)
httpd -t -D DUMP_VHOSTS
?/nagios
URL to work and thenagios.dom.com
?mod_proxy
. I might be inclined to solve you issue that way instead of mucking around with moving Nagios all around. There's an example of how to do this here: akerneladay.com/httpd-reverse-proxy-nagiosxi-step-back-in-time