How To Make your Mac a Web Server
Posted 08/05/2009 at 4:57pm
| by Arvind Srinivasan & Susie Ochs
4. Go for Ports, not Starboard
If you plan on accessing your website outside of the computer that is hosting it, and you have a router or firewall, you will need to forward the ports for HTTP to your computer. The way to do this is different for each router, but the basic process is the same. First, go to System Preferences > Network. Write down the local IP address that is shown.

Find the local IP address under Status, and write it down.
Then, go to Port Forward (www.portforward.com), scroll down, and click on your model of router. On the next page, atop the giant list of services, you’ll see your external IP (different from your local IP), and write that down too. Find Apache is the list of services and click it. On the next page, enter your local IP address as noted earlier, and follow the resulting instructions to forward the proper ports on your router.
5. Set up your Domain
Technically, this is an optional step, because you can already browse to your site at http://[your IP address here], but unless you have a photographic memory, chances are you aren’t going to remember a string of pseudo-random numbers. So you can buy a domain at a site like
GoDaddy.com or Yahoo Domains (smallbusiness.yahoo
.com/domains), but you can also register for a free domain at a site like DynDNS.com, with a little less control over what your domain actually is.

To do this, go to www.dyndns.com/services/dns/dyndns/ and click the Get Started button. In the Hostname area, type in a name you can remember, and then choose what comes after the dot in the drop-down. (We went with ourname
.dynalias.com.) For Service Type, leave the default Host With IP Address selected. Your external IP goes in the IP Address box, and there’s also a button to auto-detect it—it should match the external IP you wrote down in step 4. Click the Add To Cart button and check out; this service is free, so it won’t ask you for credit card info, but you do need to create a user account at DynDNS.com when prompted.
6. The DynDNS Updater
DynDNS Updater will keep your host name pointed to your ever-changing external IP address.
Head to www.dyndns.com/support/clients/mac.html and download the DynDNS Updater application. Load the DMG file, and drag the application into your Applications folder to install it. Launch DynDNS Updater, login with your DynDNS account credentials, and you’ll see your account name in the sidebar. Click the right-facing arrow to show your website, and select it. Check the box labeled “Enable updating for this host,” and you should be good to go. Now, if your router’s ports are forwarded properly, you can browse to your site at the domain you just created.