06 Choosing a host

This is the fifth and last lesson in the domain name courses series. Lessons
for this course are being archived at:
http://www.linuxchix.org/content/courses/domains/

This lesson will discuss the choice of a host for your domain name. It will
discuss two different types of hosting:

1. Shared hosting
2. Server hosting

--- Shared hosting ---

It is possible to host more than one domain on a single machine, having a
single web server program that answers queries for multiple domains, and an
email server that handles mail for multiple domains. There are many commercial
providers who sell the ability to host your domain on their machines (along
with other customers) -- this is generally the cheapest type of domain
hosting, and all hardware and most software configuration will be their
responsibility.

Shared hosting prices vary extremely widely and you should definitely look
around. The market is quite competitive, but some providers may charge as
much for a mailbox as others do for a website and unlimited mailboxes.

Here's the factors you should look at when choosing between hosts:

1. Location

There are a number of reasons to choose a hosting provider in your city or
country:

- Assuming they do phone support, you get cheap phone support because it's
not an international call.

- Their business hours coincide with yours, so problems that surface at 9am
your time won't be fixed by their on-call emergency night staff.

- You get low latency connections, especially useful if you have a shell
account (the ability to log into their machine and run commands) because
you can type in real time.

- The host country's content laws match yours: international law is presently
unclear on whether copyright and libel laws apply in the country of origin,
the country of hosting, or the country the reader lives in. Hosting in your
own country simplifies the first two.

However, for many people outside North America there are also good reasons to
host in the US or Canada:

- Bandwidth is considerably cheaper in North America (Australian providers
often charge end-users for bandwidth at close to US$100/GB if you exceed
your low monthly bandwidth cap, US providers charge less than a tenth of
this amount).

- Hosting competition is intense, meaning that disk space and mailbox
allocations in the US and Canada are typically more generous.

- Most of the world has fairly good connections to the US, so international
viewers of your site are most likely to be able to download it quickly if
it's hosted in North America.

These advantages are probably less applicable in Asia and Europe than they are
in Australia and New Zealand. I don't know anything about hosting in South
America or Africa.

2. Operating system

Your choice here will be more or less UNIX vs. Windows. Many of the cheap
hosting providers use Linux or another free UNIX-like operating system
(FreeBSD, OpenBSD...). Linux and *BSD hosts will almost always be using Apache
as the webserver, I'm not familiar with Windows hosting but I suspect IIS is
the most common webserver.

In general I believe Windows hosting is a premium service and you'd only want
to choose it if you're using technologies that won't work on Apache: for
example Active Server Pages (ASP) or FrontPage extensions. On the other hand,
there are many freely available programs that will work better with or are
designed for Apache: PHP, many CGI scripts and so on.

Static HTML pages will work fine with either.

3. Access

Your host will allow some but possibly not all of the following forms of
access:

1. FTP or SFTP or SCP upload of files (you're almost certain to get one of
these, and you should avoid hosts who don't let you upload your own files
using one of these standard protocols)

2. IMAP or POP access to mailboxes (this may be secure IMAP or secure POP).
Hosts that want you to download all your mail will often only allow POP.

3. Shell access via telnet or ssh.

For simple web hosting needs -- for example static HTML files -- shell access
may not be particularly useful for you, but if you want to install and test
any scripts it will be invaluable. It can also be useful to have access to log
files for your website, particularly if you have any problems getting it to
work.

Your host may allow some or all of the following to be hosted on their server:

1. Static HTML files

2. Other types of files (I've never heard of a host specifying HTML only)

3. Dynamic scripts (PHP, CGIs in Perl, Python..., Java applications)

4. Your own network processes (like IRC bots)

Most hosts will offer 1, 2 and 3 -- you'll rarely need 4 and most hosts don't
allow it for various reasons, including the potential for someone to use your
network process to compromise the machine.

If you're using CGI scripts, check with your host that they have the
interpretor for your language installed (or that compiled binaries of, for
example, C programs, will run if you need them). Most seem to have Perl,
Python and various shells. Ruby is less common but some hosts have it. Many
Perl and Python CGIs require extra modules to be installed -- ask your host if
they are prepared to do this on request.

If you have a Java backend for your website you may want to seek out a host
that specialises in Java hosting (there seem to be a lot of them).

4. Bandwidth allocation

It's hard to tell in advance how popular your website will be. The greater the
popularity, the more bandwidth you will use. However, unless you have some
particular reason to assume yours will be a very popular site or you will be
receiving an unusually large amount of email, it's normally safe to assume
your bandwidth needs will be well under 5GB/month, probably around 1GB/month
if my experience is anything to go by.

Bandwidth allowance can take a number of different forms:

- your host may not cap bandwidth (note in this case there is often a
clause about completely excessive bandwidth use, but some hosts literally
do mean "you can serve as much data as our network hardware will handle").
This is typical a fairly expensive hosting option and there's no need to
choose it unless you've got reason to believe you will need it.

- your particular choice of hosting plan may have a flat bandwidth cap
associated with it (for example, mine gives me 20GB/month).

- you may pay by the MB or GB. This is typically the cheapest option for very
low use sites. In this case, when comparing prices, do check whether the
host is counting uploads to your site, downloads from it, or both.

In the case where your bandwidth use is limited, your provider generally
offers one or all of the following options: shutting your site down until the
demand dies down; shutting your site down until the end of the billing period
(usually a calendar month); or charging you per unit of extra bandwidth used.

In the most common case, where you are charged per unit of extra bandwidth,
it's worth briefly considering the worst case scenario, where your site might
use 100GB in a month. Could you afford it? If not, you might want to ask your
host about shutting down your site if demand suddenly becomes enormous.

Reasons to believe yours might be a popular site include lots of pictures,
lots of media files, moving a previously popular site (like an established
web comic) to your site, or adult content. In these cases you'll want to
increase your estimation. However, there are certain factors outside your
control that may suddenly cause your bandwidth to increase. Being linked to
from the front page of http://slashdot.org/ is the most well known and feared
cause of bandwidth spikes -- it can make your site several hundred times more
popular than it otherwise would be, but similar effects happen with links from
other popular sites. Keep in mind these are worst case scenarios though.

5. Websites: Number of domains and subdomains

Some cheaper hosting options will restrict the number of domains and
subdomains you can host within a single account. You will want to consider how
many separate subdomains you're likely to want before choosing a host that has
this restriction.

6. Address and mailbox allocation

Since you have a domain name, you can create unlimited @example.com addresses
if your host allows you to. However, some don't.

When considering email addresses, your host will offer two distinct things:

- mailboxes: these are data stores where email ends up. Typically, every
person who uses email needs one of these to themself. A mailbox will
usually be protected by a username and password, and accessible by one or
more of IMAP, POP or webmail.

- addresses: these are username@example.com addresses: recipes for delivering
mail. The example.com server may deliver username@example.com in any number
of ways: it might put it in a mailbox, put it in multiple mailboxes or
forward it to another server

Typically people with multiple addresses don't have them delivered to multiple
mailboxes. I have about twenty email addresses people commonly use, but they
all go to the same mailbox.

These are the common scenarios:

- limited email addresses and mailboxes

- limited mailboxes but unlimited email addresses (in this case you may want
to deliver mail to multiple addresses to one mailbox, or forward mail to
some addresses to third parties)

- unlimited mailboxes and unlimited email addresses

Those are roughly in order of cheapest to most expensive but this seems to
vary very widely.

If this is your first domain name, be generous in the number of email
addresses you estimate you'll want: you may imagine you'll want one but the
lure of having different addresses for different audiences (friends, clients,
online vendors) tends to be attractive. You'll almost certainly only need one
mailbox for each *person* (not address) using the domain. If it's just you,
then one. If you're intending to let family, friends or employees use it, then
one each for them. Remember though that you can forward mail to third party
addresses too.

7. Disk space

Almost every host operates on a model where you have a fixed amount of disk
space to store all your web data and email. It seems to range between 200 MB
and 2 GB at most hosts, and getting more disk space tends to be more expensive
than almost anything else. It's likely you'll only need a few hundred
megabytes in this scenario: you're hosting a personal website with a few
photos and some data (like a weblog) -- typically these are only 20-50MB, and
you're downloading all your mail via POP or IMAP.

If you want to leave your mail on the server or if your website is enormous,
you'll need more. However, it is quite easy to estimate this by looking at the
size of your current website and the amount of email you're storing.

8. Uptime and service guarantees

Uptime is the percentage of time you can expect your website and email to be
available for. You can get as close to 100% uptime as you like by spending
more and more money -- imagine redundant servers all over the planet in
guarded security compounds as a kind of a best case scenario. Downtime happens
for all kinds of reasons, in my experience there's a few major ones:

- your host is being attacked somehow, perhaps a denial of service attack,
and goes down in self protection

- your host is upgrading software and needs to reboot or temporarily stop a
service -- this often only takes a few minutes but sometimes they may make
a mistake and have to fix it

- your host's own bandwidth provider cuts them off for any one of a number of
reasons (often a technical mistake)

Uptime is often measured in "nines": 99% uptime, 99.9% uptime, 99.99% uptime
and so on. I like to think of them in "days down per year" terms: 99% uptime
is over three days down per year, 99.9% uptime is about 8 hours, 99.99% is
about an hour and 99.999% uptime is about 5 minutes (that's the kind of uptime
you like from telecommunications providers).

For personal and small business hosting you will not always get an uptime
guarantee and realistically you should expect well over 24 hours of downtime
yearly although not all at once. Often you will be given an estimate of
downtime though, so have a look. If you're thinking of setting up an online
business on a large scale you will want to look at uptime guarantees (but in
that case you should also be hiring professionals to develop and maintain your
server solution.)

You probably won't get much in the way of service guarantees from a small
hosting provider, but there are some good signs:

- 24 hour support

- an emergency support contact which will page a support person

Now that you're armed with hosting decisions, you can have a look at the
following hosting providers. This is by no means a complete list (there are
thousands of hosting companies) and is geographically biased. These companies
have been mentioned by various LinuxChix and others to me in a positive way in
the pat, but obviously do your own research too:

- http://www.hostingmatters.com/
- http://www.1and1.com/
- http://pair.com/
- http://superb.net/
- http://www.affordablehost.com/
- http://www.nearlyfreespeech.net/
- http://csoft.net/
- http://www.cherryhosting.net/
- http://www.anchor.net.au/

--- Server hosting ---

Server hosting involves having a permanently accessible server set up
somewhere: there are many companies that provide this service. You install
whatever software you need on your server: a webserver, a mailserver, a
nameserver, and so on, and configure them yourself.

Again, I won't address the setup here, but I will make some brief comments on
advantages and disadvantages of this option, and then describe the different
ways you could have a server hosted.

Advantages of hosting your own server:

- complete choice of the type of software you run on your machine and its
precise configuration

- no need to compete with other users for resources (except in the case of
virtual servers, see below)

- the limit on the number of mailboxes, email addresses, domains and
subdomains will be the limit set by your hardware's and software's
capability -- so high you'll almost certainly not hit it

Disadvantages:

- server hosting is more expensive than shared hosting

- you will need to be, or learn to be, or hire, a good sysadmin who can
install software, configure it, secure it, and repair it when it fails

- technical support for broken software may be nonexistent or very expensive
(some providers offer a "managed server" option for extra money in which
case they will support the software)

- in many but not all cases you will need to repair broken hardware yourself

For readers of this lesson, there are probably two real reasons why you'd
choose this type of hosting:

- you either are or would like to be a good sysadmin (and trust me, this is
an excellent way to learn how if you're willing to accept that your
mistakes may cause downtime or data loss)

- you have really heavy duty needs like a custom business application or an
enormously popular website

- you have particular needs (like wanting several shell accounts) that aren't
accounted for in shared hosting pricing models

Many of the same factors apply to your choice of server host as to your choice
of shared hosting provider: hardware specifications (in some cases), price,
bandwidth, and so on.

Server hosting options

1. User Mode Linux hosting (or other virtual servers)

There's a terminology confusion here. Shared hosting, as above, is often
referred to as "virtual hosting". In contrast, a "virtual server" is a process
run on a physical machine that behaves like a real machine. Several of these
virtual servers may share a physical machine. On a Linux machine this is done
with User Mode Linux (UML), but other UNIX-like operating systems have
facilities for doing something similar and products (like vmware) are
available to make Windows and other virtual servers too.

Generally virtual server hosts sell access to one of a number of virtual
servers running on a single machine. You will generally be given root password
to your own virtual server, and the ability to install whatever software and
run whatever services you like (within reason, typically CPU intensive
applications like SETI@HOME will be banned).

Your virtual server will be sharing a physical server with other virtual
machines, although this will be largely invisible to you. This has two main
impacts:

- you will be sharing a CPU with the other virtual machines, meaning that if
someone else runs a CPU intensive process your server will be affected

- you will typically have no control over the kernel your machine runs -- it
will be configured by your host

Virtual servers are the cheapest server hosting option because many
virtual servers share a single machine. They are a good first server hosting
solution, except in cases where your processes require a lot of dedicated CPU
time (simple web serving and email processing will be fine unless your site is
exceptionally popular), or you want to control the entire machine for some
reason (like security).

2. Dedicated servers and colocation

In this model, you maintain an entire physical machine that acts as your
server. There are a few ways of doing this:

- some hosts will sell you a standard model machine, or use of it. Generally
repairs to the machine's hardware will be their responsibility, all
configuration and installation yours.

- some hosts will require that you bring your own server to them (often in a
special case called a "rack case"). You will be responsible for hardware
maintenance.

- you might host your machine non-commercially, for example on your home
broadband connection or at yours or a friend's workplace

I call the last solution "buddy hosting", and it will leave you vulnerable to
sudden changes of house or employer. For a personal server this is often OK
though.

-Mary