Forum Moderators: phranque

Message Too Old, No Replies

Can't see second version of Apache on my LAN!

using MAMP to serve web pages to a LAN

         

younify

3:33 pm on Mar 14, 2005 (gmt 0)



Hello,
I'm running MAMP on an OS X machine to try and serve web pages to a PC which is plugged into the same router.
OS X includes a default installation of Apache 1.3, which is started by activating Web Sharing in preferences.
MAMP installs a second version of Apache elsewhere (v 2.x) and runs it on PORT 8888.
There is no problem seeing pages from both versions on the local machine:
[localhost...] or [localhost:80...] (v 1.3)
[localhost:8888...] (v 2)

Also, I can see pages from v 1.3 on the PC plugged into the same router as my Mac, by checking the IP address of my Mac ethernet port, and entering it in the address bar of my browser on the pc. EG the Ip address is 125.12.20.100, entering this in the PC works:
[125.12.20.100...] OR
[125.12.20.100:80...]

But! I can't see version 2.x of apache on the PC when I enter:
[125.12.20.100:8888...]

This is driving me crazy!
Can anyone help?
Thankyou!
B

sitz

3:16 am on Mar 25, 2005 (gmt 0)

10+ Year Member



There's a big difference between 'localhost' and a regular IP address; when you type 'localhost', you really telling your browser to send the request to "127.0.0.1". You tested both Apache and MAMP with 'localhost', which means both those servers are listening on 127.0.0.1. I don't know anything about MAMP, but if it's set up to listen *only* on localhost, then it won't be able to response to requests on the 125.x.x.x IP address. If you run:

netstat -an ¦ grep LIST

You can see what's listening on the various ports on your host. If port 8888 is bound to 127.0.0.1 and not to the 125.x.x.x IP, there's you answer. =)

To fix this, you can either reconfigure MAMP to listen on your 125.x.x.x IP, or configure your Apache-1.3 instance to proxy the requests back to the MAMP server (arguably a better solution; it depends on your set-up).