How to expose a web server?

I have an Ubuntu server connected to my AirPort Extreme via an ethernet cable, and would like to expose the web server to the outside world. I've read some threads indicating I need to expose port 80, which makes sense, but I didn't see how to limit this to a specific computer.


The current IP for the server is 10.0.1.5, but this would most likely change if I rebooted the AirPort--I'm gussing this would be dependant upon the number of devices which attach to the AirPort prior to the server.


Could someone please advise me as to how to go about exposing this web server to the oustide world? Also, any thoughts on how to set a specific IP on this machine would be appreciated.


Thanks,

Rob

Posted on May 19, 2011 5:34 AM

Reply
7 replies

May 19, 2011 9:58 AM in response to Rob F

No apologies necessary, I just want to be sure which you had as the instructions to configure Port Mapping is different between them.


Basically, what you need to determine first is that all of your network clients, including the web server, will use port 80 for http. This will pose a problem if you dedicate that port only to the web server. To get around this, you would "inform" users that the URL you provide them includes a different port to use.


As an example, if your web server is reachable at http://mywebserver.com, you would use http://mywebserver.com:8888 instead.


Will this work for what you are trying to do?

May 19, 2011 11:54 AM in response to Rob F

Great! To get port mapping configured will take two basic steps:

  1. Assign the web server with a Private static IP address, and
  2. Configure the AEBSn for port mapping.


The first step actually has two options: 1) Assign the static IP address on the device outside of the DHCP range of the AEBSn, or 2) Use the AEBSn's DHCP Reservation feature to assign a "static" IP address from the DHCP pool of addresses. I will assume that you will want to go with the second option.


Here are the basic steps involved:



To setup port mapping on an 802.11n AirPort Extreme Base Station (AEBSn), either connect to the AEBSn's wireless network or temporarily connect directly, using an Ethernet cable, to one of the LAN port of the AEBSn, and then use the AirPort Utility, in Manual Setup, to make these settings:


1. Reserve a DHCP-provided IP address for the host device.

AirPort Utility > Select the AEBSn > Manual Setup > Internet > DHCP tab

  • On the DHCP tab, click the "+" (Add) button to enter DHCP Reservations.
  • Description: <enter the desired description of the host device>
  • Reserve address by: MAC Address
  • Click Continue.
  • MAC Address: <enter the MAC hardware address of the web serverr>
  • IPv4 Address: <enter the desired IP address>
  • Click Done.


2. Setup Port Mapping on the AEBSn.

AirPort Utility > Select the AEBSn > Manual Setup >Advanced > Port Mapping tab

  • Click the "+" (Add) button
  • Service: <choose the appropriate service from the Service pop-up menu or leave the default>
  • Public UDP Port(s): <leave blank>
  • Public TCP Port(s): 8888
  • Private IP Address: <enter the IP address of the web server that you created in the first step>
  • Private UDP Port(s): <leave blank>
  • Private TCP Port(s): 8888
  • Click "Continue"



May 19, 2011 11:13 AM in response to Tesserax

That's a good point about the port as, in addition to the dedicated Ubuntu box, I also run Ubuntu in VirtualBox on my MacBook--it's my development environment. So, dedicating port 80 to the Ubuntu box would most likely cause issues when trying to serve pages from within the VM. As a result, using another port would probably be my best bet.


Thanks!

May 19, 2011 3:52 PM in response to Tesserax

Thanks for the response but, I'm sorry to say, I'm a bit confused.


The Ubuntu server is connected to the AEBS via an ethernet cable as it has no wireless card/device. I have two other computes, a MacBook and an iMac, that wirelessly connect to the AEBS. My confusion is in identifying the server and not one of the two other computers. I believe that is where the MAC Address comes in, but I'm not sure how to get that.

May 20, 2011 2:09 PM in response to Rob F

The MAC address would be the MAC address of the Ethernet Network Interface Card (NIC) that the Ubuntu server had to gain network access.


This may be printed on the card itself. On OS X, you would use the "ipconfig getoption en0 chaddr" command in the Terminal to get the MAC address of the built-in Ethernet card. I believe Linux uses a similar command.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to expose a web server?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.