Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So I have Nagios installed on my server and right now I can access it at http://server/nagios/. What I would really like to be able to do is have it at http://nagios.server/. How would I be able to change Nagios to allow me to do that? I'm running Ubuntu 10.04.

Thanks!

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

It is possible with so called virtual-hosts.

Here is a part of Apache httpd config example for doing this.

<VirtualHost *>
ServerAdmin webmaster@server
DocumentRoot /www/nagios
ServerName nagios.server
ErrorLog logs/host.foo.com-error_log
TransferLog logs/host.foo.com-access_log
</VirtualHost> 

Here "/www/nagios" is pointing to directory, where your nagios pages are stored.

But nagios.server should be in your DNS records and point to the same IP as "server" record. Or you may add nagios.server to your local /etc/hosts file (or c:\windows\system32\drivers\etc\hosts)

share|improve this answer
add comment

There are some problems with what you would like to do...

1) in http://server/nagios: server is the HOSTNAME and nagios is a directory on the host.

2) in http://nagios.server/: nagios is the HOSTNAME and server is the domain that the host is a part of.

Therefore, it isn't possible to do what you would currently like to, without configuring your nagios server to have its hostname be nagios and even then you would access it by either http://nagios/ or http://nagios/nagios - depending on your httpd conf file.

Unless of course you wanted to set your hostname to be nagios and "bind" it to a domain named server

I.e. changing your hostname to be nagios.server

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.