Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 8th September 2011, 03:33 PM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
problem accessing local server by url

I have a home network set up that includes windows xp and a local server. DNS resolution allows both machines to access the internet. I know this because firefox works on the xp machine, and yum works on the fedora machine.

I can see the server index page through firefox by ip. I can't see it by url.
/etc/sysconfig/network settings:

NETWORKING=yes
HOSTNAME=fred.mycoachdomain.com

I purposely used a mixed up hostname so my browser wouldn't find it on the internet.
/etc/hosts shows fred.mycoachdomain.com next to 127.0.0.1


The third line down in /etc/hosts is: 192.168.0.2 fred fred.mycoachdomain.com
I can access the server's index file with this ip, but not with this url. I've tried putting http:// before it.

/etc/resolv.conf lists the ip's of 2 nameservers. Nothing else.


/etc/host.conf settings: multi on order hosts, bind


I know apache is working because I always access by ip before I try by url. I type
the long url into firefox. It can't reach the index file.
Reply With Quote
  #2  
Old 8th September 2011, 06:28 PM
allanhitch Offline
Registered User
 
Join Date: Jan 2011
Location: New Hampshire
Age: 56
Posts: 39
linuxfedorafirefox
Re: problem accessing local server by url

Quote:
Originally Posted by settingsun View Post
I can see the server index page through firefox by ip. I can't see it by url.
/etc/sysconfig/network settings:

NETWORKING=yes
HOSTNAME=fred.mycoachdomain.com
.....

I know apache is working because I always access by ip before I try by url. I type
the long url into firefox. It can't reach the index file.
Hi Settingsun,

Just for the heck of it, try adjusting the "hosts" line in "/etc/nsswitch.conf" to read:
dns wins files

If you have the DNS set up correctly with your target hostname, it should work.

If I read your post correctly, you said the XP boxes hit it just fine. That tells me that DNS is most likely set up correctly. (if I'm mistaken, and you don't have a DNS on your local netowrk, that could be the problem...)

While it won't actually solve your problem outright, you may also want to make sure you have winbind installed (part of the samba suite - samba-winbind & samba-winbind-clients). I find that it helps me when I'm on MS-based networks.

Keep in mind, I'm just suggesting a sort of quick experiment. I've found that a simpler line in the nsswitch file seems to work very reliably, as long as there is either a good DNS server locally, or the machine I'm looking for advertises it's SMB shares.

Also, you could put the target system's name in /etc/hosts if you're only on that one network and the target has a static IP. Then again, with DNS set up with a correct entry, you shouldn't have to do that.

-Al

Last edited by allanhitch; 8th September 2011 at 06:31 PM. Reason: forgot something
Reply With Quote
  #3  
Old 8th September 2011, 06:56 PM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
Re: problem accessing local server by url

Currently my /etc/nsswitch.conf hosts variable reads: files dns.

What is this file? I'm going to take some time to read up on it.

/etc/hosts does local DNS resolution, right? /etc/hosts should be all that's needed to for the server to find the ip from the url, right?



Thanks
Reply With Quote
  #4  
Old 8th September 2011, 07:22 PM
allanhitch Offline
Registered User
 
Join Date: Jan 2011
Location: New Hampshire
Age: 56
Posts: 39
linuxfedorafirefox
Re: problem accessing local server by url

Quote:
Originally Posted by settingsun View Post
Currently my /etc/nsswitch.conf hosts variable reads: files dns.

What is this file? I'm going to take some time to read up on it.

/etc/hosts does local DNS resolution, right? /etc/hosts should be all that's needed to for the server to find the ip from the url, right?



Thanks
Hi Settingsun,

I could stand to read up on nsswitch myself, but basically it lists, for lack of a better word, data files, or databases pertaining to services...

I re-read your post and you said the third line down in your /etc/hosts file is:
192.168.0.2 fred fred.mycoachdomain.com

hosts doesn't actually do a DNS resolution, it takes the place of DNS. (actually, DNS takes the place of the "hosts" file, but that's an old debate....)

... a couple questions....

Did you say that you have a local DNS server on your network?
...and
Are your XP boxes able to resolve that host and get the proper page?

If the 1st question is no, the the hosts file should direct you to the right host.
If the 2nd question is no, then there might be a problem in the /etc/httpd/httpd.conf file (or one of the associated includes).

Just for grins, try pinging fred.mycoachdomain.com. Next, try "nslookup fred.mycoachdomain.com". The former will tell you if your system is actually resolving that name properly. The latter will tell you which DNS server is trying to resolve the name. If you don't have an internal DNS box, that last command won't accomplish anything.

Let me know the results... I'll be here for a bit....

-Al
Reply With Quote
  #5  
Old 8th September 2011, 07:39 PM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
Re: problem accessing local server by url

Hi again -

No local DNS server.

Ping fred.mycoachdomain.com returned an ip I'm not using anywhere on my system. That ip not responding.

nslookup <ip returned by ping> returns:


Name: fred.mycoachdomain.com

Address: <ip returned by ping command above>

I have a router on my home network. Ping returned an ip I'm not using, so that must mean that request is going to the internet , even though /etc/host.conf tells the resolver to check /etc/hosts first.


Based on the results of ping and nslookup, it looks to me like when I access the server by ip the request goes to the server. When I access by url the request goes to the internet. Could this mean my router settings need to be changed for url request to server?

Last edited by settingsun; 8th September 2011 at 07:53 PM.
Reply With Quote
  #6  
Old 8th September 2011, 08:14 PM
allanhitch Offline
Registered User
 
Join Date: Jan 2011
Location: New Hampshire
Age: 56
Posts: 39
linuxfedorafirefox
Re: problem accessing local server by url

Quote:
Originally Posted by settingsun View Post
Hi again -

No local DNS server.

Ping fred.mycoachdomain.com returned an ip I'm not using anywhere on my system. That ip not responding.

nslookup <ip returned by ping> returns:


Name: fred.mycoachdomain.com

Address: <ip returned by ping command above>

I have a router on my home network. Ping returned an ip I'm not using, so that must mean that request is going to the internet , even though /etc/host.conf tells the resolver to check /etc/hosts first.

AHA!!!!! There's the issue!

DONT'T reconfigure your router! Unless you've configured it for VLANs, it should never even come into play. Of course, I'm assuming that the target machine is on the same subnet as the workstation(s) your trying to reach it from.

There's got to be something in your /etc/hosts file that's messing things up. Make sure that the very first character of the first entry is the beginning of the IP address, then do a couple spaces, then (to simplify) just put the name "fred", then save the file. At that point, you should be able to "ping fred" and get back the IP (which appears to be 192.168.0.2)

Since you don't have an internal DNS, the nslookup command won't find your machine, or any of the machines on your network. It will poll whatever DNS you're using (which appears to be your ISP).

One other thing to check..... make sure you (temporarily) turn off your firewall and disable selinux on that target machine. (This is just to rule out any weirdness and make sure you're going to get a response once you do start resolving the name).

If you like, go ahead and paste the /etc/hosts file here.....

Oh.... just to make sure we're on the same page, I'm talking about the hosts file on the workstation, NOT the target.... (lots of people make that mistake, and I just wanted to make sure...)

-Al

Last edited by allanhitch; 8th September 2011 at 08:17 PM. Reason: addition
Reply With Quote
  #7  
Old 8th September 2011, 08:25 PM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
Re: problem accessing local server by url

I pinged by ip successfully. Pinging fred failed.

How do I paste a fedora file using xp?


Thanks!


I don't know what selinux is. I don't know what a workstation or a target is. I call my local machines xp (windows xp) and the server.

I don't yet know how to use xp to paste a fedora file, but here are the settings in the /etc/hosts file:


127.0.0.1 fred.mycoachdomain.com localhost.localdomain localhost
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.2 fred fred.mycoachdomain.com

That's it. I don't know if the number of spaces between these settings is important. I purposely put 2 spaces between the settings in the last line and had saved ( :wq return in vi editor).

Tried again - still nothing.

Last edited by settingsun; 8th September 2011 at 08:54 PM.
Reply With Quote
  #8  
Old 8th September 2011, 08:39 PM
allanhitch Offline
Registered User
 
Join Date: Jan 2011
Location: New Hampshire
Age: 56
Posts: 39
linuxfedorafirefox
Re: problem accessing local server by url

Quote:
Originally Posted by settingsun View Post
I pinged by ip successfully. Pinging fred failed.

How do I paste a fedora file using xp?


Thanks!
Copy /etc/hosts to a USB drive, or across the network over to the XP box. Then open it with wordpad...

Make sure that you're not trying to edit the hosts file with ANY MS-based editor!

Out of curiosity, are you trying to reach the Fedora box from another linux workstation, or from the XP machine?
Reply With Quote
  #9  
Old 8th September 2011, 08:57 PM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
Re: problem accessing local server by url

Trying to access from windows xp. I'm learning to build a server. This is the "rubber meets the road" stage. Preparing to use xp to check my build progress.
Reply With Quote
  #10  
Old 8th September 2011, 09:11 PM
allanhitch Offline
Registered User
 
Join Date: Jan 2011
Location: New Hampshire
Age: 56
Posts: 39
linuxfedorafirefox
Re: problem accessing local server by url

Quote:
Originally Posted by settingsun View Post
Trying to access from windows xp. I'm learning to build a server. This is the "rubber meets the road" stage. Preparing to use xp to check my build progress.
Have you been editing the hosts file on the Linux box, or on the XP box?

If you're accessing the target from the XP workstation, then you must edit the hosts file on the XP workstation. You'll find it located in "c:\windows\system32\drivers\etc". It uses the same format (basically) as the Linux version. Enter:

192.168.0.2 fred

That will do it.
Reply With Quote
  #11  
Old 8th September 2011, 09:28 PM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
Re: problem accessing local server by url

No. I didn't know there was an xp hosts file. How do I access that from xp command line? Is it just typing the path you showed me right into the xp command line, or is there a command?

I was assuming I could access the server from xp just like I can access anything else online. Oops.


I went to the windows xp command line and typed:

c:\windows\system32\drivers\etc\hosts and xp returned:

Not recognized as internal or external command.

Last edited by settingsun; 8th September 2011 at 09:49 PM.
Reply With Quote
  #12  
Old 8th September 2011, 09:51 PM
allanhitch Offline
Registered User
 
Join Date: Jan 2011
Location: New Hampshire
Age: 56
Posts: 39
linuxfedorafirefox
Re: problem accessing local server by url

Quote:
Originally Posted by settingsun View Post
No. I didn't know there was an xp hosts file. How do I access that from xp command line? Is it just typing the path you showed me right into the xp command line, or is there a command?

I was assuming I could access the server from xp just like I can access anything else online. Oops.
You can access the hosts via the GUI, or do a CD command. Make sure you edit it in wordpad. Notepad will try to put an extension on it and screw it all up. When you're done, just save. Don't "Save As", or you'll run into trouble.

From the command line, you can cheat and just type in:

echo 192.168.0.2 fred >> c:\windows\system32\drivers\etc\hosts

Remember, whatever operating system you're on, the hosts file only affects that workstation. If you edit a hosts file on one machine, that machine only will resolve that entry. If you want the rest of them to resolve it, you'll have to edit their hosts file as well.

If you're setting up a home network, I strongly recommend installing a DNS server. (Use the package manager on your Linux distro and look for the Berkely Internet Name Domain server. I actually have two set up on my home network. One, of course, is the master (Start of Authority, or SOA), the other is pretty much a caching-only server. Windows, Linux, even friends who bring over their MACs grab the values from my DHCP server (did I mention I had that set up too?) and resolve internally and externally.

Otherwise, about the only thing you can do is to install Samba on the Linux boxes, establish a share, and make sure it starts at each re-boot. Of course, you'll have to delve into the configuration of each system (DNS, or SAMBA), but that's a whole new thread!

Linux does not publish itself like MS does. It's a whole different deal... and nothing takes the place of a properly set up DNS!

Once you have your hosts file(s) properly configured (on your workstations, I think you'll find the problem is solved. (at least that problem!)

-Al
Reply With Quote
  #13  
Old 8th September 2011, 10:09 PM
settingsun Offline
Registered User
 
Join Date: Aug 2011
Posts: 150
windows_xp_2003firefox
Re: problem accessing local server by url

I typed in that command and windows xp returned: Access denied.

At least now I have a much better idea of what the problem is. I went to a website looking for a tutorial on this and found a cartoon balloon that said:

"There's no place like 127.0.0.1" I got a good laugh out of that. The learning curve continues...


Thank you very much for your help.
Reply With Quote
  #14  
Old 8th September 2011, 10:23 PM
allanhitch Offline
Registered User
 
Join Date: Jan 2011
Location: New Hampshire
Age: 56
Posts: 39
linuxfedorafirefox
Re: problem accessing local server by url

Quote:
Originally Posted by settingsun View Post

"There's no place like 127.0.0.1" I got a good laugh out of that. The learning curve continues...


Thank you very much for your help.
Any time.

From your "Access Denied" message, you'll probably need to log on to the XP box(es) as the administrator, or a user with admin rights. Then you should be all set.

It sounds like you're getting a handle on it anyway. That's the main thing.

The learning curve with any new O.S. is looooooooooooooooong! With Linux, it can be pretty steep too!

Well.... it's quittin' time and it's time for me to learn what's for supper....

Hang in there and keep plugging away. It's worth it.

Glad I could help point you in the right direction.

-Al
Reply With Quote
  #15  
Old 8th September 2011, 10:35 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,105
linuxfedorafirefox
Re: problem accessing local server by url

The problem is not DNS.

the problem is your /etc/hosts file.

This file searched sequentially, starting at the beginning.

The first entry for fred.<whatever> is given the IP number 127.0.0.1.

That is the only entry that will be used. The third line down with 192.xxx assigned to fred.<whatever> will not be used.

Since you didn't list what the IP number was that ping returned, I can't tell if it is the localhost reference or not (though I think it is).
Reply With Quote
Reply

Tags
accessing, local, problem, server, url

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with accessing http server alansilicon Servers & Networking 5 23rd February 2009 12:16 PM
Problem samba server accessing xp Alerander Servers & Networking 0 20th August 2005 03:14 PM
Accessing a local service from the net - proxy - firewall syn Servers & Networking 19 26th April 2005 03:51 PM
Accessing a local area network kumarannair Servers & Networking 7 4th December 2004 01:25 AM


Current GMT-time: 21:32 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat