this is Part 2 of the 3 part series "Have a Mac? You Have a Web Server!", Part 1 can be found [here].
When you connect your computer to a cable or DSL router (that's the box-thingy that Comcast or Verizon gave to you so you can read FaceBook), you are "findable" on the web- that's good . Good, because we can serve websites to the world now. There are 2 possible ways you are connected to your cable or DSL router- 1, directly through ethernet or 2, wirelessly through Airport/Airport Express or 3rd party Wireless router like Lynksys. My experience in through ethernet and Airport Express, so we will cover that scenario.
We will be working from your web serving Mac, so if you have more than one computer in your house, get on the Mac you intend to be the web server.
![]()
Get your web server's IP address
- Go to /Applications/Utilities on your hard drive and open the "Network Utility" app.
- In the window choose the method you're connected to your Modem, Ethernet or Airport (pic).
- Write down the resulting IP Address below.
Note:
In the case that you're connected directly to your modem with ethernet, that's probably your external IP address that the world can find you with. In the case of this tutorial, it's the "local" IP Address that Airport Express gave your Mac when you connected to it.
Ethernet directly connected to cable modem
This is really simple- you're already connected. YAY! Open Safari or Firefox and type in the IP address you just wrote down (in the browser's address bar). You should see the same web page you saw when you opened http://localhost on your web server (see http://neutralgood.net/blog/2010/03/15/have-a-mac-you-have-a-web-server-part-1-installing-your-server/)
Skip the rest of this article and go on to "Part 3: Find Me Please."
Ethernet directly connected to DSL Router
There are so many different routers and variations, I'd say just consult your user guide for setting up "Port Forwarding." You'll want to port-forward ports 80 to the IP address of your computer.
Using Airport to connect to the internet? No Problem! Port Forward!
Like the DSL router, the Airport Express needs to be configured for people to find your webserver in your wireless network. By default, Airport Express blocks all incoming traffic (not requested by your computers). We're going to tell it what traffic it can allow and where to send it.
- Go to /Applications/Utilities on your hard drive and open the "Airport Utility" app.
- Select the Airport Express icon in the left-hand column that connects directly to the modem (pic).
- Click on the "Manual Setup" button at the bottom of the window.
- Select the "Advanced" icon at the top of the window (pic).
- Click the "Port Mapping" button just below the top icons (pic).
- Click the "+" button below the "Port Mappings" window.
- Fill in the following (pic):
- Public Port Number: 80
- Private IP Address: your web server's IP address
- Private Port Number: 80
- Click "Ok"
- Click "Update" and wait for the Airport Express to restart.
- When you see your Airport Express icon come back up in the left-hand column, click on it.
- If the "Manual Setup" button is there again, click it.
- Write down the IP Address at the bottom of the resulting window, we'll use this to test your web server's connectivity to the outside world.
- Open Safari or Firefox and type in the IP address you just wrote down (in the browser's address bar). You should see the same web page you saw when you opened http://localhost on your web server (see http://neutralgood.net/blog/2010/03/15/have-a-mac-you-have-a-web-server-part-1-installing-your-server/)
Ports aren't just for sailors anymore!
