Web Hosting

So... you made yourself a website in HTML class?


Congratulations!


But... now what?

What we'll cover

  • Hosting: how a file on your computer becomes a public website
  • Components of hosting and website architecture
  • Options and tradeoffs of various hosting providers

Your local development environment

  • So far, you've been creating and opening "local" files in this workshop
  • It's just a file living on your computer
  • You can tell from the address bar whether a file is local from the addressC://My Documents, file:///Users/me
  • Goal of hosting is to get those files to a place where anyone can see it

Can that place be your computer?

  • By default, random people on the internet can't access your computer
  • You can give them permissions though
  • Example: you can set up a webserver on your computer
  • Downside: your files are inaccessible when your computer is off
  • Common solution: put your files on another server that stays on

Enter: Hosting

Hosting: a place where you can put your files, made accessible via a server being run on a computer someplace else, managed by someone else

Example: Gmail

  • When you check your Gmail, you see your Inbox
  • Your browser fetched this page and your emails from another machine hosting the files
  • From a server, managed by Google

Example: Gmail

Example: Wordpress

  • When you create a website on wordpress.com
  • Your website files are running on a server somewhere else
  • From a server, managed by Wordpress

The World Wide Web

Clients vs. Servers

Clients make requests, servers fulfill them (usually).

Requests are like questions: clients ask them, and servers answer them.

For our web discussions, client = browser.

While any type of computer can be used as a server, they are generally larger and more powerful than others.

Client applications run on a client machine that you are interacting with (like your browser)

Server applications run on a machine someplace else, that your client or client application can talk to

Hosting your client application

Your index.html and style.css files are client code.

They are run by your web browser to display your page.

To make it so that anyone's browser can load them up, we will put them on a computer somewhere else (the host)

A server on that computer somewhere else will be the gatekeeper that lets anyone's browser load up your files (the client code)

In this example, your code is the client code, and the server only acts as a gatekeeper

So, which hosting provider should I use

Types of Hosting Providers

  • File stores: a place to put files; Example: S3, Github Pages, Dropbox
  • Package Providers: a place where you can get a domain name, optional preinstalled software; Example: wordpress.org, bluehost.com
  • Roll your own: a place where you can set up and manage all the website components on your own, including databases, servers, domain names, etc. Example: EC2, Heroku, Linode, Digital Ocean

When to use them?

  • File stores: when you just need to make static files available
  • Packages: when you need a cheap way to roll out a whole website (for a small business for example), and need everything to "just work" but don't need customization
  • Roll your own: when your software or business dictates you need full control; for example, most tech companies build their own website architectures and hosting solutions

Tradeoffs

  • File stores: good for static pages or client applications, insufficient for server applications
  • Packages: good for people who want to create and manage content, frustrating for techies who want more control or want to use software components not on the "allowed" list
  • Roll your own: more time consuming, need to be a techie to implement and maintain, but full control, ability to deploy/host any kind of client or server application, often cheaper

Domain hosting

  • IP addresses
  • Domains
  • DNS
  • Registrars

Internet Protocol (IP) Addresses

Used by computers to identify one another online, usually arranged into four sets of digits.

Look up your IP address by simply going to whatismyipaddress.com.

Domains

[subdomain].[domain].[topleveldomain]
  • maps.google.com
  • www.whitehouse.gov
  • www.ontario.coop

As .com, .net, and .org use isn't restricted, they are used more flexibly than as originally intended.

Domain Name System (DNS)

Translates domain names into the IP addresses that allow machines to communicate with one another.

Look up GDI's IP address by typing into Terminal (Mac) or Command Prompt (PC):
nslookup girldevelopit.com.

Registrars

Used to purchase a domain.

Look for:

  • Good customer service
  • Easy-to-use admin interface
  • Pricing (no hidden fees)
  • Allows transfer of names to other registrar
  • ICANN Accredited

Popular registrars: GoDaddy, NameCheap, Google Apps

Home and daily life of a web site

A typical website lives on a web server. Web servers are often large computers connected to a network.

  1. Type a web address into the address bar
  2. DNS connects you to the hosting server
  3. Files are then sent back to your computer for display
  4. Sometimes code must be compiled before being sent back to you.

Example: Twitter

THE END

Mary Ann & Truc