ISP-In-A-Box: The $500 Mac mini (Chapter VIII, Going Live!)

It’s time to put the final piece in our puzzle and actually “Go Live” on the Internet with our ISP-In-A-Box. “We don’t have a web site yet,” you might be saying. Actually, we do. Go to http://localhost, and you’ll see it. It just doesn’t do much. But we will fix that early next week. If you want a preview of the data-driven web site we plan to build on your computer next week using PHP and MySQL, just click on this link. Once it’s built, you can customize all of the web content for your site using PhpMyAdmin to edit a simple MySQL database. It’ll even support Google Ads (as shown in the sample) if you decide you want to get rich quick or you can paste your favorite family photo on the top of your web page, but we’re getting ahead of ourselves. Our task for today is to get you a fully-qualified domain name so that people can access your web site from the Internet without typing http://24.98.82.246 (or whatever IP address has been assigned to you by your ISP).

Prerequisites. In order to complete today’s tasks, you should already have bought your Mac mini and activated the Apache Web Server. Before you can build a data-driven web site next week, you’ll need to install MySQL and PHP. If you haven’t already gotten this far, consider this your Saturday Night homework assignment. The entire ISP-In-A-Box series is now available in PDF format for download here.

Deciphering Your IP Address. Before we can link a domain to your IP address, we first need to know your IP adddress. If you don’t know it, you can obtain it by going to http://mundy.org/ip.php from the web browser on your Mac mini on the network connection where you plan to run your web server. You’ll also need to know whether you have a static (stays the same) or dynamic (ever changing) IP address. Chances are it’s dynamic.

Choosing An Internet Service Provider. Most ISPs only provide dynamic addresses unless you pay an additional fee. For about the same money, you can obtain a full-service web hosting account. Can you use a dynamic IP address and still host a web site from your house? The answer is maybe. While still using dynamic IP addresses, many ISPs including many cable providers rarely change your IP address. My experience with both Time Warner and Comcast is that they force an IP address refresh about once every six months. If you use one of these providers, you’re in pretty good shape hosting a web site from your home. Fortunately, AT&T is out of the broadband business. For a time, they actually blocked incoming port 80 access to customers’ machines. However, there’s even a workaround for that problem now which we will get to. At the other extreme in the ISP world are PPPoE providers such as Earthlink which disconnect, reconnect, and change your IP address regularly during the day, if not the minute. These ISP’s are all but unusable for hosting a web site from your home. If you have service from one of the latter ISP varieties, you have two choices: use your ISP-In-A-Box as a staging server and purchase a web hosting account for your “live” web site or switch to a more accommodating Internet Service Provider.

Choosing a Domain Name. There are two approaches in selecting a domain name for your ISP-In-A-Box. First, you can select a name such as wmundyhome.dyndns.org which rides on someone else’s domain and provides dynamic updating of your IP address whenever your ISP changes it. Or, second, you can purchase any available domain you like (such as webify.us), and manage IP address changes yourself. Either approach works. The latter is obviously more personal and more professional. And, with the right ISP, the manual updates of your IP address are not that burdensome. The two examples I’ve provided actually both point to the same server in my basement which is connected to the Internet through a Comcast cable modem. There used to be a significant difference in the cost of the two options; however, that has all but gone away. The dyndns.org solution is free, and the personalized domain is now less than $10 per year from many sources.

Using DynDNS.org. If you opt to use dynamic IP address updating, you first will need to register at DynDNS.org and obtain a username and password. What we’re going to do in this scenario is link a dynamic IP address to a static hostname for your computer. There is no cost. Whenever your ISP changes your IP address, your router’s built-in update client will notify dyndns.org of the change (after you configure your router to do so), and the DNS table will be updated for all the world to see. Step 1 is to select a hostname for use with one of dyndns.org’s registered domains. There are several dozen domains from which to choose. Log in to your dyndns.org account, click on Dynamic DNS, and then choose Add a Host. Enter the hostname you wish to use (your name with no spaces usually works well) and select a domain from the pull-down list. Then enter the IP address of your Internet connection which you obtained earlier. You’re finished at dyndns.org, and your qualified domain name (joeschmo.homeip.net) should be accessible on the Internet within a few hours. Sometimes it takes a bit longer. This domain name will continue to find your web site until your ISP changes your IP address.

To find your web site after an IP address change, you either have to manually update the address on dyndns.org’s web site, or you have to configure an update client to do it for you. Most new hardware router/firewall’s have this capability built in, but you’ll need to configure it. In addition, there is a Mac application, DNSupdate, which can do it as well. We covered that in our first ISP-In-A-Box installment although I hope I’ve pursuaded you not to put all your security apples in one basket to save a measly $30.

To configure your router for dynamic IP address updating, open the router admin program using your web browser. Typically, there is a Dynamic DNS menu option. You then would specify www.dyndns.org as the provider and insert your fully-qualified domain name, username, and password just as you entered it on the dyndns.org web site. Save your changes, and you’re good to go.

Using Your Own Domain. Becoming the master of your own domain is not a big deal these days. What used to cost hundreds of dollars is now under $10 with lots of features that we just happen to need. To make sense out of this article, we really needed to set up a domain to play with so we could walk you through all of the steps. I’ve done that with webify.us, which now is pointing to a server in my basement that’s connected to a Comcast broadband Internet connection through a Netgear wireless firewall, router, and print server. Yes, we do eat our own dog food before offering it up to you. We’ve chosen Omnis.com as our domain registrar for two reasons: they’re dirt cheap ($7.95 per year for most domains) and they offer a great feature set (DNS Manager, URL forwarding, and proxy routing) at no additional cost for those that want to run a web server out of their own home. Are there other suitable providers? Absolutely. But you need one that provides the feature set I’ve described, and no one today is any cheaper than the one we’ve chosen. Register.com provides a similar service for only $35 a year or $19.99 a year for multiple years. So you do the math.

The first step is obviously to select a domain that no one else has already registered. Most registrars have a link on their site to let you test various domains until you find one that’s available. For our example, we chose webify.us. Pretty clever, huh? Once you select your available domain, the registrar’s web site will walk you through the registration process during which you will set up a username and password to manage your domain. Write it down, and don’t lose it! It is a huge hassle to prove who you are these days. Make certain that you choose to use the registrar’s name servers during the registration process. Once the registration process is completed, go do something for a couple hours while your account is being set up. Your domain may not actually be available on the Internet until tomorrow.

The second step is to log into your account at your domain registar’s web site. In the case of Omnis.com, you click on the Manage My Account tab on the main page. Once you’re logged in, click on the Manage DNS option. You’ll be warned that this is dangerous but continue on. Once you get to the DNS page, click on one of the little question mark icons and read about Proxy and URL record types. These aren’t really legitimate DNS record types. They are special routines to make it easy to point a domain at a home IP address or a non-standard HTTP port, i.e. not port 80. Remember, I told you about AT&T’s cute trick of blocking port 80 access. The proxy record would let you point your domain to a different port, e.g. port 81 and reconfigure Apache to host your web site from that port.

For our purposes today, we’re going to use a Proxy record to point our new domain to our home IP address. Move to the DNS Manager – New Record section of the web form and make two entries. For the first entry, insert just the values shown below in italics on the form (leave the other fields alone) and use your own home IP address in the Content. Then click the Add New Record button.

  • Namewww
  • TypePROXY
  • Contenthttp://111.111.111.111
  • For the second entry, insert just the values shown below in italics on the form (leave the other fields alone) and substitute your own home IP address in the Content. Then click the Add New Record button again.

  • Name@
  • TypePROXY
  • Contenthttp://111.111.111.111
  • Now all you need to do is wait (usually several hours but it can take a day) for the DNS information to propagate to the DNS name servers, and you should be able to reach your home web site using your new domain name from anywhere on the Internet. That’s all there is to it … until your ISP changes your IP address. When this happens, just log back in to your registrar’s web site and modify the two entries above to point to your new IP address. Within a few hours, you’ll be back in business. Join us next week and we’ll build a real data-driven web site on your Mac mini that you can fill with any web content you desire. Have a great weekend.

    Be Sociable, Share!

    7 Responses to “ISP-In-A-Box: The $500 Mac mini (Chapter VIII, Going Live!)”

    1. Doug says:

      Anything further on changing from port 80 to another port. I can only access my MacMini home page from my internal network. Any access attempts from outside times out. I called my ISP but couldn’t find anyone that has the faintest idea of what I’m talking about.

      [Sure. As you’ve learned, another great feature of many ISP’s is that they not only play dumb, they really are. There’s no doubt from what you’ve said that they are blocking port 80. Many ISP’s just don’t like to acknowledge it. Here’s what you need to do. Read our article (above) on Going Live. There are only a couple of steps involved. First, you need to tell your Apache web server to “broadcast” your web site on port 81 in addition to port 80. Open a Terminal window and switch to root access: sudo su. Edit the Apache config file located in /etc/httpd: pico httpd.conf. Search for Listen 80: CTRL-W,listen 80,enter. Add a line below it (with no pound sign) that reads: Listen 81. Save your changes: CTRL-X,Y,enter. Restart Apache. Test it by using a web browser on your Mac web server to go to: http://localhost:81. If your site pops up, it’s working. Then you need to use a domain registrar for your domain that supports proxy DNS records. Omnis.com is a good one. The service is free. Transfer your domain there if you have to. They’re also the cheapest around for domain renewals. Make certain you configure Omnis.com name servers as your default domain servers. Then choose Manage DNS, Enable This Feature for your domain. Click the Help (?) button and read up on Proxy records. You’ll want to delete the two existing A records (# and www). Then create two new Proxy records (# and www) that point to the IP address of your home server on port 81. The syntax is http://youripaddress:81. If you don’t know your IP address, go to http://mundy.org/ip.php, and it will tell you. Wait a day or two, and things should be working swimmingly. Good luck!]

    2. Sam says:

      http://www.no-ip.com/ allows you to purchase a domain name and apply it to a dynamically changing ip address!

    3. kevin says:

      If my network is NAT’ed, how can I access my server that’s behind the router? In other words, how do I access individual machines in my home network if they all have the same IP address?
      – Great website, by the way. When are you going to write the “Asterisk Hacks” book for O’Reilly?

      [WM: No book plans, thanks. As for access to individual machines behind the same firewall, the answer is to use different ports. For example, you could have a web server on one PC on port 80, and the next one on 81. If you want to access the same service on two different machines and the service only supports one port, then you’re SOL on one of the two machines. Apache can handle different port addresses. Some other apps can’t.]

    4. Bobby says:

      Great article.

      Zoneedit is another great site that allows you to setup your own domain name. It provides DNS service and MX records for your email as well. You can establish 5 zones for free. Additional services are charged at a very modest rate.

      Thanks for all the great information on Asterisk.

    5. Chris says:

      Could you please tell me how to set up a static IP address on this Asterisk box I just set-up. Not a real strong unix guy here.

    6. Sai says:

      Hi Great Article. You Guyz rock Man!! BTW, I’ve a quick question. If I port forward port 80 to my internal IP then how can i access my router/firewall page again? Because as we all kow the router runs on port 80 and when we enter router’s IP address, by default it connects to port 80 of the router. But now if we port forward this port to the Internal IP then how can we get back to our router? Excuse me if its a silly question

      [WM: Most routers let you adjust the access port for remote access to the router. Just set it to 8080 or something other than 80, and you’ll be all set.]

    Ringbinder theme by Themocracy