 |
 |
resolving 127.0.0.1 when disconnected from network
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2001
Status:
Offline
|
|
I'm using my OSX laptop to develop a website which contains URLs of the form "/html/foo.html", i.e. all references are specified relative to the "root" of the site. I've placed my site in the directory "/Library/WebServer/Documents". When I'm testing them (in IE 5), I use "http://127.0.0.1/html/foo.html" This works perfectly as long as I'm connected to the network (via Ethernet), however, it gives me a "The specified server cannot be found." whenever I am not connected.
I would so much love to get paid to work on this site while drinking wine in the cafe down the street. What can I do to get OSX to resolve 127.0.0.1 to my "/Library/WebServer/Documents" directory? What I understand about networking you could fit into a thimble. Can anyone explain what's going on here?
thanks, all,
Jonathan[/LIST]
|
|
|
| |
|
|
|
 |
|
 |
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
i think (and don't shoot me here, if i'm wrong), that you need to have yourself a new setting in Network. call it Standalone and give it the IP of 127.0.0.1, so it's not looking for anything else. i had to do something like that on my iBook, then i could sit in the garden and do my perl stuff, etc
wine level is gaining, so try that and respond quick
|
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2001
Status:
Offline
|
|
Huh. More testing reveals some weird things:
Internet Explorer 5 (for OS X) will work *temporarily* if I try a 127.0.0.1 URL and then disconnect from the network: it will receive the served pages for a brief time, all links work, etc. and then it will suddenly stop being able to resolve the URL correctly, and, in fact, will not be able to resolve any URL correctly ("The specified server cannot be found") after I re-connect to the network. Quitting IE and restarting it clears that up.
Mozilla, on the other hand, works as it should, and resolves all 127.0.0.1 URLs regardless of whether I'm connected or not. Good for Mozilla. (however, none of my elaborate Javascript and CSS works in Mozilla, but that's a whole nother kettle of fish)
IE 5 for Classic doesn't work. Neither does Netscape 4.7.
So possibly the problem is just with IE for OS X. (Maybe I should try Opera or iCab or OmniWeb, if they can handle my incredibly ****ing baroque JavaScript, alas)
Philzilla, I tried your suggestion, but it didn't do the trick. I'm coming to think that it's just some messed-up behavior with IE. Someone else suggested building a loopback Ethernet plug like this, at the bottom to fool the computer into thinking it's connected to a hub. Weird, right?
EDIT: fixed messed-up URL
[ 02-21-2002: Message edited by: megabulk ]
|
|
|
| |
|
|
|
 |
|
 |
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
whatever that link is, i think you need to edit it
well, that's how i got mine to work, so i can't really think how to solve your thing. i'll keep thinking though.
anyone? 
|
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
| |
|
|
|
 |
|
 |
|
Admin Emeritus 
Join Date: Oct 2000
Location: Boston, MA
Status:
Offline
|
|
Try using localhost. That routes directly to your computer.
You can also add hostnames (if you're using virtual hosts and whatnot) through NetInfo Manager if you so desire. I forgot how to do this, though... Should be somewhere on the net.
|
|
"Against stupidity, the gods themselves contend in vain" (Schiller)
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2001
Status:
Offline
|
|
philzilla, I fixed the link. And I'll give your method another shot: IE's behavior (working for a little while and then ceasing to work) indicates to me that perhaps some host lookup is cached and then refreshed from somewhere  , and maybe I just didn't give your method enough time for IE to pull its head out of whatever idiocy it's jammed up?
parallax: I tried 'localhost' and it delivers exactly the same results (or non-results) as 127.0.0.1, but, again, maybe I need to give IE a little more time? <-- which sounds totally insane
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Nov 2001
Status:
Offline
|
|
Parallax: now this sounds promising:
You can also add hostnames (if you're using virtual hosts and whatnot) through NetInfo Manager if you so desire. I forgot how to do this, though... Should be somewhere on the net.
, probably just because I don't understand it  and because I bow down to the almighty power of NetInfo... I will poke around.
|
|
|
| |
|
|
|
 |
|
 |
|
Admin Emeritus 
Join Date: Oct 2000
Location: Boston, MA
Status:
Offline
|
|
Wow, I've never seen that happen. Sometimes if my service (non-service, I guess  ) is down, 127.0.0.1 won't work, yet localhost will.
If localhost isn't working though, I highly doubt that NetInfo will help ya much (you basically tell it "host.tld maps to 127.0.0.1").
|
|
"Against stupidity, the gods themselves contend in vain" (Schiller)
|
| |
|
|
|
 |
|
 |
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
i've had this the other way round before: localhost gave me a dns error (i think? i got an error anyway), yet 127.0.0.1 worked fine
have you altered anything in your apache.conf? specifically around the ServerName area?
|
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status:
Offline
|
|
This plagued me since PB.
In my case, I have three modes of operation:
1) home with broadband behind a linksys router with dhcp but no local dns (machines on my private lan are unresolvable)
2) work with dhcp and dynamic dns (dns is updated when you get your IP lease from dhcp)
3) disconnected
Here is what works for me in all cases:
1) edit "/etc/hostconfig" and set your hostname to whatever you want it to be called (ie: "my_laptop").
2) go to network settings and set the DHCP Client ID to the same name.
3) go to sharing preferences and set the Computer Name to the same name.
4) open NetInfo Maganer and add a node:
/machines/
name my_laptop
ip_address 127.0.0.1
serves ./local
incidently, I also added the other machines on my homes private network (192.186.1.whatever) so that they resolve by name as well
like:
/machines/
name my_quicksilver
ip_address 192.168.1.100
serves ./local
and:
/machines/
name my_cube
ip_address 192.168.1.101
serves ./local
etc..
now, I am able to access machines at home by name and I am able to run things like mysql, jboss, tomcat while I am disconnected and still have my hostname resolve in all modes.
The only time this setup wont work is if you have broadband at home and are foolish enough to plug it straight into the wall without a hardware firewall/router. This is because the ISP will most likely want your hostname to be something specific, but in that case, just use the name they give you and you should be good to go.
|
|
signatures are a waste of bandwidth
especially ones with political tripe in them.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|