Setting up a VPS for website hosting - Introduction

Addendum

I was busy with graduate school and was unfortunately unable to update and complete this guide. However, I recently broke my Linode server while trying to update to Ubuntu 20.04 LTS (which is an awesome release by the way!). I have been having issues lately where an ssh prompt will freeze a connection to the server if there is too much inactivity, and that happened in the middle of my do-release-upgrade script. Because of this, I found out about Linode's StackScripts. I created a custom StackScript that will automate the majority of this process. See page 5 for instructions on using this automated script.

Disclaimer: I am not a web developer. I like tinkering with servers and web development, but if you want a much more customized way to make a website, I can forward you to proper web developers. This blog post is aimed at beginners who want to learn about servers and how websites work behind the scenes. I like tinkering with servers and scripts, so I wanted to write about setting up a website using a cloud hosting website such as Linode instead of AWS (Amazon Web Services) and explain what I’ve learned along the way. This server was setup in a similar way using Linode.

Terms & Definitions

The most used term is a VPS - Virtual Private Server. If you’re not familiar with this, the first question to ask is what is a sever.

Server - A server is a piece of hardware that can run an operating system that can be anywhere in the world. A server by itself is like a mac mini by itself, or the tower of a desktop computer. It contains all the parts to be a computer (CPU, hard drive, RAM, etc) but it doesn’t have any peripherals to interact with it (mouse, keyboard, monitor). They don’t have any peripherals because they can be accessed remotely through the internet, and because those peripherals would take up space. Companies will have several servers stacked in huge racks like a Marshall stack of amplifiers, and they are all connected to the internet. The clients can then “remote” into the server on a different computer using a software like Windows Remote Desktop Connection (RDC). The software uses the client’s peripherals to navigate. Servers running Linux instead of windows (which are the majority of servers) will typically only have a command line interface to the computer instead of the graphical user interface (GUI), since that’s all that’s necessary to use a Linux computer.

Virtual Private Server – It would be very expensive in terms of space for a company to have one chunk of hardware for each client they serviced. A full computer as we know it has an excessive amount of capabilities for web hosting. Web hosting doesn’t need a super strong CPU or a lot of RAM. A web server just needs to send a file to whomever is on the site. By going to this link, your browser is downloading an html file and a few css/javascript files from my VPS. There’s not much computation going on. Instead, a single server can be separated via software to act like several servers sharing the same resources. It is as if your computer was being used by 10 people at the same time, thinking that they’re the only one using the computer and not knowing that other people are using it. Each VPS has a unique IP address.

IP Address – These are the addresses of the internet. One analogy is to compare it to street addresses. If I gave you the address 123 Apt 4 5th Avenue, New York, NY 10003 and asked you to find it on a map (not Google maps where you can search it), there are several tiers of information to digest. The first is NY, the state. Then New York, the city, so you can exclude the rest of upstate New York on your map. Next would be the street name, then the building number, and finally the 4th apartment.

Domain Name - Shorthand, user-friendly name for a server's IP Address. In my case, my domain name is cindybui.me and it is an alias for my IP Address.

DNS (Domain Name System) - Essentially the address book of the internet, mapping everyone's IP Addresses to domain names.

Receiving a website over the internet takes a few steps, similar to finding the location of an address. When you type in a link like cindybui.me, your computer first asks your internet service provider's (ISP's) DNS resolver for the most generic level of information.

In our address example, New York State is the most generic level of information. This corresponds to the top level domain (TLD) of a domain name. Mine is .me

Your computer receives the most generic piece of information, then methodically finds more specific information. For my domain name, cindybui is the next part of the domain name, so the ISP has to search within the .me TLD and look for cindybui - just like looking for New York City once you're in New York State. This location is stored in a nameserver. Linode has their own, free, nameservers.

Depending on the website, there may be more back-and-forths between the computer and the ISP - just like finding 5th Ave, building 123, and apartment 4.