LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 01-05-2013, 08:59 AM   #1
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 56

Rep: Reputation: 1
Could not login to nagios through hostname


Hi,

I have installed nagios in centos 5.8 but I can only login by giving http://localhost/nagios and http://IPaddress/nagios

I have given my hostname as rahul in /etc/sysconfig/network and also in the /etc/hosts file as 127.0.1.1 rahul

But I want to login as http://rahul/nagios

The nagios page doesn't appears. Please help.
 
Old 01-05-2013, 09:06 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Where are you trying to connect from? Another machine on the same LAN?

Kind regards,

Eric

Last edited by EricTRA; 01-05-2013 at 09:07 AM. Reason: typo :-)
 
Old 01-05-2013, 09:13 AM   #3
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 1
Hi eric,

I have installed nagios in my system and I am trying to login as http://rahul/nagios
The hostname of my system is rahul
Even I tried on other machine to connect from on the same LAN
But why the nagios page doesnt appear??
 
Old 01-05-2013, 09:25 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Are you serving the Nagios page through Apache/httpd? It does work when you use http://localhost/nagios right, from the server itself? Does it work using http://rahul/nagios from the server itself?

Kind regards,

Eric
 
Old 01-05-2013, 09:33 AM   #5
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 1
hi eric,

Yes I have installed httpd on my system. It works when I use http://localhost/nagios

I have not installed nagios on any server. As I told you that I have installed nagios in my desktop. When I give http://localhost/nagios it works.

But if I give http://rahul/nagios from my desktop itself,it never work. Please help.
 
Old 01-05-2013, 09:35 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

What did you add to /etc/hosts to indicate rahul as hostname? And what do you have as value for the Listen directive in httpd.conf? And did you reload network services and the httpd daemon for the changes to take effect?

Kind regards,

Eric

Last edited by EricTRA; 01-05-2013 at 09:36 AM. Reason: restart services added...
 
Old 01-05-2013, 09:49 AM   #7
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 1
Hi eric,

I have added a new line as 127.0.1.1 rahul in /etc/hosts file. I have not checked httpd.conf file
 
Old 01-05-2013, 09:52 AM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

Do you mean you did it like this:
Code:
127.0.0.1   localhost.localdomain localhost
127.0.1.1   rahul
If so, why not use it like this:
Code:
127.0.0.1   localhost.localdomain localhost rahul
Also check your httpd.conf file for the value of the Listen directive. If that one is set to 127.0.0.1, then of course your solution with 127.0.1.1 will not work. And you need to reload/restart the affected services to apply changes.

Kind regards,

Eric
 
Old 01-05-2013, 09:58 AM   #9
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 1
hi eric,

yes i did like this

127.0.0.1 localhost.localdomain localhost
127.0.1.1 rahul
 
Old 01-05-2013, 10:00 AM   #10
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

And what's in the httpd.conf file for the Listen directive? Try changing your hosts file according to the example I put.

Kind regards,

Eric
 
Old 01-05-2013, 10:41 AM   #11
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 1
h eric,

Ok i will try to change the hosts file as suggested by you. My system IP address is 172.16.92.217. So if I give in the hosts file as

127.0.0.1 localhost.localdomain localhost
172.16.92.217 rahul

will it work???

I think I should also put the IP 172.16.92.217 in httpd.conf file right, if I want to access from other system in the same LAN??

please help

Last edited by rahul.buragohain; 01-05-2013 at 11:14 AM.
 
Old 01-06-2013, 02:31 AM   #12
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

If you add that line to the hosts file to indicate the host rahul, it will work from that same machine. If you want it to work across the LAN then you'll need to set up each hosts file on each and every machine you want to use so that it contains all the IPs and hostnames you want to connect. Or... setup a local DNS server.

Since it's only on your LAN I would not change Apache to only listen on the 172 IP although you could do it. If the Listen directive is set to 127.0.0.1 you can change it to 0.0.0.0 to make Apache listen on all IPs on your machine.

Kind regards,

Eric
 
Old 01-06-2013, 03:06 AM   #13
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 1
Hi eric

If my /etc/hosts file is

127.0.0.1 localhost.localdomain localhost
127.0.1.1 rahul

will it work across the LAN and shall i be able to access from all machines???

If the Listen Directive is changed to 127.0.1.1 , will apache be able to listen on all IPs of the machies in the same LAN??
 
Old 01-06-2013, 03:21 AM   #14
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

No, it will not. All addresses in the 127/8 network bind to the loopback interface (the lo interface) and not a network interface. So you either need to set it up with a LAN IP or always access on the same box.

Same thing applies to Apache. If you set the Listen directive to an IP that binds to the loopback interface then you'll only have local access. If you set the Listen directive to 0.0.0.0 it will listen on all IP addresses configured, so if you then configure your hosts file with the LAN IP and hostname on each and every machine from which you want to connect OR setup a DNS server for your LAN, it will work. Otherwise it will only work locally.

Kind regards,

Eric
 
Old 01-06-2013, 03:37 AM   #15
rahul.buragohain
Member
 
Registered: Aug 2011
Location: India
Distribution: RedHat, Centos, Fedora, SuseLinux, Ubuntu
Posts: 56

Original Poster
Rep: Reputation: 1
hi eric,

so what is ur suggestion? what should I entry in /etc/hosts file and in what value should I set in the Listen directive??
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to rename the hostname without affecting current time in nagios nandhapswan Linux - Server 4 01-05-2016 03:00 AM
ssh login using hostname peeths003 Linux - Networking 8 12-23-2009 07:46 AM
SSH Problem - Can't login using Hostname, can login using ip address jqweezy Linux - Networking 7 01-26-2009 02:21 PM
Nagios Login Error sbhupati Linux - Software 8 06-01-2006 06:21 PM
login problem nagios misba672 Linux - Newbie 2 10-14-2003 07:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration