Here's that technology model of your website.

Technology mental model

Let's talk about the domain part. It's good practice to put each course its own home, separate from other courses. I put each course in its own subdomain. So, if you had several courses, they might be:

  • https://dogcourse.yourdomain.thing

  • https://catcourse.yourdomain.thing

  • https://hippocourse.yourdomain.thing

Notice the https://, instead of http://. The s means data to and from the site is encrypted. Many hosting companies automatically make new domains use https:// automatically. You want this.

When you signed up for your hosting account, you grabbed yourdomain.thing. When you're ready to make a course, the first thing you do is to make a subdomain for it. Use the control panel software your hosting company gives you. cPanel is the most common. From your control panel home:

Getting to subdomains in cPanel

Now create your new subdomain.

Make a subdomain

You fill in the subdomain name, and choose the domain it's associated with. cPanel will fill in the document root for you. That's the folder on the server where the files for the subdomain will be stored.

Subdomain file root

Click Create, and you're done! cPanel will show you a list of your subdomains, with the new one added.

To test it, open a new browser tab, and go to the subdomain. You should see something. If you don't, it may be that it takes a while for your changes to be applied, but they should be quite fast.

About the document root thing. Your server has files and folders, just like your PC. It has lots of folders, used for different things.

One way to think of a URL is as a path to a folder on your server. When someone types the URL https://bats.flappything.net/vampire.html, they are asking for the file vampire.html in whatever folder is assigned to https://bats.flappything.net.

A URL Is a file path

Knowing a URL is like a path to a file on a server, helps with some tasks you'll do later.

It also helps you organize your courses. Suppose you had two courses on your server, at the domain https://earnestpugs.net:

  • A coffee course, at https://coffee.earnestpugs.net

  • A painting course, at https://painting.earnestpugs.net

Pug

You want to keep the files for the courses separate, to avoid Messes of Doom. For example, you don't want files uploaded by students in the coffee course, to interfere with files uploaded by students in the painting course.

Clever you put files for each course in their own folders on your server. It's convenient to use the subdomain's name for the server's folder name as well. So:

  • The files for the coffee course go in the folder coffee.earnestpugs.net.

  • The files for the painting course go in the folder painting.earnestpugs.net.

You can think of a subdomain as a folder on your server. It's not strictly true, but is mostly true, and is enough for our purposes.

Onward!

Section contents

Database
Installation
Using the terminal