Wednesday, June 6, 2012

Bought a Domain

I recently bought a domain name, c-jar.es, and set up a web server on my laptop (note that I actually took the server back down now). I'll go over some issues I faced and some things I learned, so you can avoid some of the bad things that come with buying a domain and setting up a server.

Reader beware: this is a long post. I started rambling, so what? So skim if you get too weary from my boring writing! First, we'll need to go over some vocabulary that you'll need to know (or will find out) when you buy a domain name.

  • IP Address - a series of numbers that represents a machine that is connected to the internet. You'll usually encounter IPv4, but soon IPv6 will be standard.
  • IPv4 - four numbers ranging from 0 to 255 separated by periods: 145.223.274.105
  • Domain Name - a name that maps a name of a website (ie. www.google.com) to its IP Address.
  • TLD - Top Level Domain. You probably know most of these: com, net, org, edu, gov, info, me, co, etc. Some are for specific purposes, such as edu and gov, but most have had their restrictions lifted. For example: com, net, and org are no longer for commercial applications, organizations involving network technologies, and non-profit organizations, respectively.
  • Sub-Domains - A domain that is a member of a higher-order domain. For example, Google is a sub-domain of com, www is a sub-domain of google.com, and images is a sub-domain of www.google.com
  • Ports - Every machine has a set of places it can receive and send information. Each of these is a port. Web pages are sent over port 80. Mail is port 25. Microsoft's Remote Desktop is 3389.
  • Server - An actual machine that is hosting a service over the internet. Most servers are hosting either web servers, email servers, database server, etc...
  • ISP - Internet service provider. Think Comcast, Century Link, Quest...

That's all you need to get through the rest of the post!

I've never bought a domain name before, so I was really clueless when I first looked into it. I didn't know how servers hosted websites, how domain names were sold, or anything about actually telling the internet where c-jar.es was located!

I started off by looking for domain names at Go Daddy, and I found the one I wanted. I used Spain's top level domain: ES. It fit with the rest of my name: c-jar. When you look for domain names, try to look for weird combinations, maybe you want your first name and last initial. So Sylas B. could go for syla.sb. Not a bad use of the Solomon Islands TLD, and you got a 6-letter domain! Maybe you can snag your last name in an obscure top level domain, and then create a sub-domain for each member of your family (or just you). If your last name is Smith, than smith.rw is still open! And that's the first TLD I tried.

A great tool for searching domain names is domai.nr. I would definitely recommend it over Go Daddy because while Go Daddy directly sells domains, it doesn't lease all of the TLD's. Domai.nr finds lots of great domains and a lot of times sites will offer a discount when you click the link from domai.nr to go to their website!

Once I bought my domain for $15/year (most domains are cheap like this, unless you get a shorter domain name), I had to figure out how to tell the Internet that the website for c-jar.es was being hosted on my IP address. To do this (in Go Daddy) I went to
  1. Go Daddy
  2. Domain Manager
  3. DNS Manager (Zone File Editor)
  4. Selected Add Record
  5. A - Host
  6. Filled out my IP address and I was done!
Note here that my IP address could actually change at any time. Most residential ISPs only offer dynamic IP addresses. This means I'm not guaranteed to keep my IP address. Every time I reconnect, they could change it. Real web servers are hosted behind static IP addresses. They don't change, so you can always access their site.

Server Setup Tips


I won't get into the nitty-gritties of the setup for the server setup, but for those who care, here's a little info. I used the latest versions of Apache, PHP, and mySQL (all 32-bit, for compatibility with PHP). I ran into a lot of trouble, so here's some advise. Double check your ports. Make sure port 80 is open for TCP/UDP in and out (Router settings and Windows Firewall + any other firewalls you may have). Make sure that your HOSTS file contains "*internal IP address* web server you're pointing to". So in my case it was:

10.0.0.2     c-jar.es

Make sure you follow all the instructions very carefully, and if you hit trouble, look for log files! They're so so so so very helpful. I was stuck for the longest time before I checked the log files.

Actually Making the Webpage


If you want to do some real good web editing, I suggest upgrading your Notepad++ (or god forbid notepad.exe) to Aptana Studio 3. Not only does it come with a great dark theme, but it comes with its own Apache, Ruby, Python, PHP, (and more) servers, while still allowing you to specify the versions of apache, php, etc. It then allows you to update your server. It makes it so easy!

I have some projects I want to work on, now that I have a web server. Specifically, I'm going to make a link shortener, probably on the c-jar.es/s/ directory of my web site. I also want to make a social aggregate site that allows me to manage all of my accounts easier. Maybe that will fail, I'm not sure :). It's a lot to do. I also want a home page with links to stuff I like, my accounts, blogs, resume, etc. Lastly, I want to host my own blog there.

Lastly, you may be wondering why you can't access c-jar.es! This is because I was cheap and didn't want to pay for the hosting. I did set up a server on my own laptop, but now I'm not sure it's the best idea for security and energy reasons. I may eventually pay for hosting (I'm a fan of HostGator), but I might just as well use my parents' old desktop once I get back to UNL in the fall.

That's it! Thanks for reading, and I hope you learned something. Follow me on twitter and tweet to me. You can subscribe to my posts either by RSS. If you don't have an RSS feed reader you can use http://www.feedmyinbox.com/ to send the RSS straight to your email! It's easy as pie.