Linking OS 9 to OS X

aicul

Registered
I develop sites using PHP/mySQL in OS X and would like to test these sites using the browsers (IE and netscape) under OS 9. Given that the OS 9 runs in classic mode under OS X.

I seem to fail to get the OS 9 browsers to connect to the OS X PHP server.

Any ideas? :eek:
 
Hmmm, interesting question. I assume you mean you have apache/php/mysql running on your OSX system, and on that same system you're running classic to test the OS9 browsers? I hadn't ever tried that, so I just had to boot up classic and check it out.

My internal ip address, which is what I usually use, didn't work at all. Localhost didn't work either -- I got an error message that Exploder doesn't support that protocol. Both of these methods work fine in OSX. But when I used http:// with localhost it worked fine, like so: http://localhost. Exploder loaded the site, the php executed, and the database queries worked.

Give that a whirl and see if it works for you.
 
Worst case scenario, try using 127.0.0.1 if the Classic environment has a hard time resolving the name "localhost".
 
Do you use a proxy server? I do, and I have to have my system set to ignore the proxy for my localhost address. Otherwise, the browser goes out onto the internet looking for localhost, instead of looking at the machine it's on. This is the case in both OSX and OS9.

Before we dig any deeper in troubleshooting this, though, let's clarify one thing: Are you able to successfully load your php/MySQL sites on your local machine in your browser under OSX? (Whether by using localhost, or 127.0.0.1., or your local IP address - which would probably be either a 192.168.xxx.xxx or a 10.0.xx.xx address.)

If not, then we need to get that working for you first. If yes, then we can focus on the OS9 issue.
 
Here is the extra information. You will see I have the simplest of settings.

I have a iMac, it is NOT connected to internet, PHP and mySQL work when used in pure OS X (either myname.local or 127.0.0.1).

The problem is getting OS Classic browsers to see my site which resides on OS X.

As per the proxy, I have no idea if one is installed by apple, and if it was what its settings are. If you tell me where to look, I'll check.

Thanks
 
It turns out that Netscape (at least, the version I have in Classic, 4.77) just doesn't really like connecting to localhost. Netscape will connect on my machine if I use http://my-ip-address (like, http://192.168.0.1) but not using localhost and not using 127.0.0.1.Exploder will connect to my local sites using any of those, as long as I put a http:// in front of it.

Apple doesn't install any proxy by default. If you were using a proxy you would know it, because you would have had to configure it manually. (I use a proxy because I'm on a satellite internet connection and get my internet through my PC, which goes through DirecPC's proxy servers.) But -- hmmm, I'm remembering an issue from years ago when I was in an office with a proxy server. To connect to the internet, I had to enter a proxy server address but then tell Netscape not to use it. It won't hurt for you to try a similar trick. Go into Netscape's preferences, Advanced, Proxies, and select the radio button "Manual proxy configuration." Click the Configure button. Enter any random IP address in the HTTP proxy field. While you're in there, go to the "No proxy for" field and enter localhost, 127.0.0.1, and your internal ip address.

Now try connecting to your site. If it still doesn't work, go back into preferences and change the radio button from Manual proxy to Direct connection, but leave the proxy information filled in in the Configure section. I don't recall exactly how I had to configure things way back when, but I do know I had to enter proxy information and then not use it.

It wouldn't hurt to quit and restart Netscape when you make these changes.

Be sure you try all versions of your address: localhost, http://localhost, 127.0.0.1, http://127.0.0.1, and both ways with your machine's internal IP.
 
sonjay said:
... with your machine's internal IP.

Thanks for the insights, I will try them and get back.

I remain confused on one issue. I always thought the internal IP of my iMac was 127.0.0.1. The way you state this makes me think this is not correct. :rolleyes:
 
You are correct, 127.0.0.1 is your Mac's internal IP. It's the internal IP of every computer in the world. 127.0.0.1 is the "localhost loopback address." It's like the word "me" to a human. Every human is named "me," and every computer is 127.0.0.1.

On a network, computers also have an IP address on the network. On my home network, for example, my PC can't access the web sites on my Mac by using 127.0.0.1, because to the PC, 127.0.0.1 refers to itself. Nor can it use localhost, for the same reason.

So the PC has to use my Mac's internal network IP address. If I recall correctly, 10.0.x.x and 192.168.x.x are the address ranges reserved for internal networks. A router that assigns IPs internally on a network will always use IPs in one of those ranges for internal network addresses, and if you assign your computer's address manually you should always use one of those ranges. I assign all mine manually so that they're fixed. That way I can bookmark my Mac sites on the PC to do site testing easily without worrying about what my Mac's IP address is today. Both the Mac and the PC use my 192.168.x.x. address to access sites on my Mac.

Those addresses are only recognized within your internal network, and the router itself will have a separate, external, IP address on the internet. If you wanted to use your Mac to serve web sites to the outside world using your IP address, for example, you'd have to give people your router's IP address, and then configure the router to forward requests to that address to your computer.

So if my PC is 192.168.0.1 and my Mac is 192.168.0.2, my PC can reach sites on my Mac by using 192.168.0.2. But no one outside my network can reach any of my computers by using a 192.168.x.x. IP. (Edited for clarity.)

So 192.168.0.2 would also be my computer's internal IP address, and is what I'm referring to when I say "and your computer's internal IP." If your Mac isn't networked at all, you might not have any IP besides 127.0.0.1, though.

That's probably more information than you wanted to know, but it might matter here. In my testing, Classic Netscape would only reach sites on my Mac when I used my 192.168.x.x. address. Both localhost and 127.0.0.1 failed with Netscape. Only the 192.168.x.x address worked at all on Netscape.

It's been so long since I've had a non-networked computer I'm not sure how internal IPs work when you're not on a network. You could go into System Preferences -> Network, click the TCP/IP tab, and see what it says in the IP Address field. If there's something there, that should be your computer's internal IP address, and you could try using that address in Classic Netscape.

I'm totally unknowledgeable about how IPs work between Classic and OSX on the same computer. I only know that I can launch Classic and access external web sites without a problem from any Classic browser. Classic Exploder had no trouble reaching any of my Mac sites by using any of the three addresses. Classic Netscape seemed to like the 192.168.x.x. address, and failed totally with both localhost and 127.0.0.1. So if your computer behaves like mine, you might have to use your computer's internal (non-127.0.0.1) address to access your local sites with Netscape.
 
Thanks, as you state more than I asked for but still educational. I will give it a go and get back after some serious testing. Thanks again. :D
 
Back after testing. I tried the 127.0.0.1 and this did not work. Netscape indicates the server is not responding. :mad: I tried various flavours for the url, all either failed as unknown or indicated the server was not responding.

I was wondering whether the use of the internal url 127.0.0.1 could be an error. I mean - Is OS9 aware that it is running under OSX? If it is not aware, then it probably will not direct http traffic to OSX. Hence using 127.0.0.1 to ask a browser under OS9 to reach OSX services will not work.

Any ideas?
 
If you read through that last long-winded post of mine, you'll see that's exactly how Netscape behaved for me -- it just wouldn't recognize 127.0.0.1. But it did recognize my internal 192.x.x.x. address. Did you check your System Preferences to see if you have such an IP, and did you try that in Netscape?

Interestingly -- Internet Explorer (Classic version) did recognize 127.0.0.1. Have you tried Explorer in Classic to see what happens?

I understand you want to test in Netscape under Classic, but if Explorer under Classic works (or doesn't work) that will help us pinpoint the issue.
 
I cannot use browser under classic because when I select it, the OSX browser starts. So I don't think this can help us here.

As per the internal Ip address I have looked everywhere for it with no success. The closest thing I got to was somewhere in preferences where I could change my computers name. The help for this screen indicated that I should choose the service I wanted - internet - and then the address would appear on the screen. Guess what - it didn't.

So maybe I should as the question differently: How can I set the IP address of my iMac to 1.2.3.4?
 
Go to System Preferences -> Network, click the TCP/IP tab, and see what it says in the IP Address field. That would be your IP address.

If you're not worried about networking your Mac, you can probably set your IP to whatever you want -- but you should stick with either a 192.168.x.x or 10.0.x.x address.

And are you sure you have the Classic version of Explorer? When I double-click mine, it launches Classic and then launches under Classic.
 
sonjay said:
And are you sure you have the Classic version of Explorer? When I double-click mine, it launches Classic and then launches under Classic.

AN ASIDE: Yes and No.
It took me a while but then I caught it...

If you have OSX Explorer running and you click OS9 Explorer, this will start classic, start OS9 Explorer and then transfer the window to OSX Explorer followed by a close of OS9 Explorer. Watch the dock and you'll be surprised.

If you do not have OSX Explorer running and you click OS9 Explorer, the OS9 Explorer starts normally.
 
sonjay said:
Go to System Preferences -> Network, click the TCP/IP tab, and see what it says in the IP Address field. That would be your IP address.

It reads 0.0.0.0.

I tried changing the number but to no avail in both Classic Netscape and Explorer ( ;) now that I know how to start it).
 
I'm back after numerous tests and have moved forwards. Hope this info will help me iron out this problem once and for all.

The reason IP addresses did not work for me seem to be related to the fact that my iMac is not connected to a network. HOWEVER, if I activate airport + create a network, an IP address is immeadiately attributed by OSX.

From here Netscape under OS9 will reach OSX sites using the indicated IP address. :D

There is a catch though. If the site is PHP based, Netscape will scream all hell that the server is not responding. In this case the trick I found was to manually set the IP addresses of ethernet services (!!!) to 127.0.0.1.

This solution works but has 2 weaknesses, maybe someone can help here:

1. The assigned IP address is never the same. This is a nuisance. The IP cannot be hardcoded in URLs.

2. Airport must be on and a network created, this is a security breach I would like to do without.

Any ideas?
 
Back
Top