Let other computer view the localhost over a network

localhostnetworking

I have apache and what not running on my local machine (mac), there also another mac on the local network. How does this other machine access my localhost?

For example I have a local website at example.local.net in my vhost. How can another computer on the network navigate to this site?

Best Answer

You have to edit /etc/hosts on the other mac and add a line like this:

192.168.x.x example.local.net

192.168.x.x it's you LAN ip. You can retrieve it by using ifconfig command in the Terminal.