Part 7 - How do websites work?Written by Eric Muss-Barnes, 10 December 2018
In the last article, I explained how your computer gains access to the Internet. But, I still didn't explain how websites actually work, and you can't build a website, until you understand how they function. Before I get into that, let me give you a brief history of how the first websites came to be...
The World Wide Web was initially started as a way for researchers to communicate with one another. With researchers from all around the world coming together with different computers, and different file types, and different operating systems, it was impossible to efficiently share documents.
As Morpheus said in The Matrix, "Fate, it seems, is not without a sense of irony."
Because the first website every created, at CERN laboratories in 1991, taught people... how to create websites. Here is the URL of the first website ever made:
That first website is still up and running, although the text has changed over the years. The man who created the world's first website was Sir Timothy John Berners-Lee, an English engineer and computer scientist. Now, Sir Timothy obviously didn't invent websites all alone. Many brilliant people created networks and systems decades earlier, and Sir Timothy couldn't have accomplished what he did without their contributions. Nevertheless, Sir Timothy is credited as the Man Who Invented The World Wide Web, because he is the one who connected the final pieces in the puzzle, to get the Web up and running, as we know it today.
At first, websites were just simple black text, on a white background, with blue, underlined "links" connecting you to other pages. You could click your mouse on a link, and that would take you to a new webpage. The first webpages could also display photos, and have bold headlines, and show grids of rows and columns, like graphpaper.
And that was about it.
The first websites didn't have much functionality beyond those simple layouts.
The underlying code used to link these documents, and give them some consistent formatting, was called "HTML", which was an abbreviation for Hypertext Markup Language. To this day, HTML remains the basis of all websites. Over the last 20 years, the capabilities of HTML has expanded dramatically, by standardizing other languages and new ways of formatting an HTML document, but the core of HTML remains very much the same.
These days, webpages still contain text and links and headlines and images, but our ability to change the aesthetic display of those elements has vastly improved. There are fancy forms of navigation, and animation, and video, and all sorts of features which simply were not technically possible in the first iterations of HTML.
As I go through this course, I will teach you how to build a simple HTML page, much like the first one built by Sir Timothy, and we'll slowly progress from there, getting more and more sophisticated with each new lesson.
The biggest question everyone has, once they begin to grasp the massive scope and size of the Internet is, "How do you find anything?"
Right? It's like standing in the biggest library every built, and having to find one specific line from a Shakespeare play, with books that have blank covers. How is that possible?
I mean, it's one thing if someone gives you a specific URL to visit. But what if you need to look up some information? What if you don't know where to locate something? How can you search for things on the Internet?
That is where special websites called "search engines" come into play.
Search engines are websites which actually index and catalog every single webpage, of every single website, all over the entire Internet. When the Internet first began, the most dominant search engine was www.AltaVista.com, which pioneered many of the features of search engines today. AltaVista was shut down in 2013 and no longer exists. The most popular search engines today are www.bing.com and www.google.com.
Most modern browsers also have search engines integrated into the URL field. So, instead of visiting the website directly, you simply type the text of what you are seeking in the address field, hit the "ENTER" key, and you will be redirected to a page of links with the most relevant search results.
Thanks to search engines, something incredibly sophisticated - finding information among billions of pages on the Internet - has been distilled into something quite simple.
There. You now you know how to find things on the Web and you have a brief history of how websites originated.
But how do you actually build one?
What are the first steps?
Now, in the previous article, I explained domain names and web servers.
Domain names are the address you type into your browser to access a website.
Web servers are the physical computers containing files that display websites.
How do those domain names get created?
And how do those files get onto the web servers in the first place? Two very big questions.
Those are the two main components to setting up your own website.
First you need to purchase your own domain name.
Second you need to lease storage space on a web server to store the files for your website.
This article will teach you both of those things.
HOW DO DOMAIN NAMES GET CREATED?
There are special companies which keep a record of all the names of all the websites ever created. These companies are called "domain registrars". One of the most popular registrars is GoDaddy.com, who had a famous spokesmodel in the form of racecar driver, Danica Patrick.
So, let's pretend you want to start a business on the Internet selling your grandmas brownies. You want to call it YummyBrownies.com.
The first thing you would do is look up a domain registrar on the Internet and go to their website.
You could then search for YummyBrownies.com and see if someone else owns it.
If no one else has invented that name, it's yours to purchase.
Purchasing the domain is called "domain registration". The fees are usually very affordable. Perhaps $10 to $15 a year.
But, once you purchase your domain, you still haven't created a website. You are simply buying the rights to that name. This assures you own that name, and no one else can ever use it, or build a website under that URL. The name belongs to you.
When the Internet first began, some crafty people tried to make a quick buck by using this registration process to steal trademarked names. Since the Internet was so new, there were a lot of large corporations who didn't own the domain of their company name. So, individuals would buy those names and try to resell the rights to the companies. Sometimes it worked, and the people were able to get a lot of money. Sometimes it failed, and the people would get sued. A lot seemed to depend on how much money was being requested and the attitude of the lawyers.
I have personally used a number of different registrars over the years. I even had one situation where a registrar was going out of business, so I had to transfer my domains to a new registrar. I would recommend you do some research, using a search engine, and just go with the largest and most popular registrar. Don't go with some off-brand company in an effort to save $5 a year. Be sure to purchase your domains from a trusted source.
Once you own your domain, you need to lease some space on a web server to hold the files of your website. This service is called "web hosting".
HOW DO YOU HIRE A WEB HOST?
Web hosting is a service provided by a company to store files which comprise your website. Web hosts often have large data centers filled with numerous web servers. And like so many other services, web hosts often have different packages or plans you can purchase, based upon the needs you have for your website.
There are 3 important variables to understand when selecting a web host.
1.) The amount of storage space you have.
2.) Knowing if you are paying for "shared-hosting" or "dedicated-hosting". (Don't worry, I'll explain those two terms later.)
3.) Knowing what kind of languages are supported in your plan.
Let me give you more details on those three things.
WHAT IS THE AMOUNT OF STORAGE IN YOUR WEB HOSTING PLAN?
The most common variable between different hosting plans is the amount of storage space you are given. Just like renting a garage or storage space in the physical world, a larger quantity of space obviously means a higher price. Typically, even the cheapest hosting plans include a massive amount of storage space, so there's no way you will buy something too small for your first websites.
Another variable can be how many websites you plan to host on your plan. For example, I have upwards of a dozen websites. Some for skateboarding projects. Some for writing projects. One for my personal portfolio. And so forth. And so on. But, I don't receive a dozen bills to pay for all of them. I just have one bill, because all of my websites are hosted with the same company, under the same plan.
WILL YOUR WEB HOSTING PLAN BE SHARED OR DEDICATED?
When people are making a very simple website, they often purchase what is known as a "shared-hosting" plan. Shared-hosting plans are the most economical. In a shared-hosting plan, your files are stored on a large web server, along with numerous other customers. This is why it is called "shared-hosting"; because you are literally sharing the storage capacity of the hard-drives with other users.
A more expensive service is called a "dedicated-hosting" plan. As you have probably figured out from the name, a dedicated plan means there is one web server dedicated to you and your files. There are no other customers using that physical computer. It belongs exclusively to you.
Which one should you use?
That depends upon your needs. If you are building a website for personal use or for a small business, shared-hosting is fine. All of the sites I have ever built for my books or for projects like this one, use shared-hosting. In fact, most companies I have worked for, with the exception of Disney, have used shared-hosting for their websites too.
Large corporations or businesses with special needs tend to use dedicated-hosting. In fact, if you are building a special website with unique functions or experimental features, a web host may insist you use dedicated-hosting, because they can't risk having your code crash their shared machines, and bringing down websites owned by other customers.
Again, this is a lot like selecting new phone service. I can tell you there are lots of options for phone services, but I can't tell you which one to get. You may be 19 and single, or you may be 38 with a spouse and 4 kids, and the telephone needs of those two people will be very different. I can't really tell you what kind of web hosting plan you should purchase for your website, but I can make you aware of the potential options you will be given, so you can make the best decision for your needs.
You may have heard the term "cloud" or "cloud computing" or "cloud services" or people talk about saving files onto the "cloud". Well, there is no such thing. The "cloud" is simply a hip and trendy marketing term for a server farm. The cloud is nothing new. Technically, the mainframe computers back in the 1960's were in the "cloud", but back then, no one ever used the word "cloud" to describe the network.
However, I will extend an olive branch to my derision of the term "cloud services" by saying they do have one very cool and legitimately powerful feature called "virtual machines".
Virtual machines are basically web servers that are software-based instead of hardware-based. This means, instead of your server being one physical machine, in one physical location, the functionality and power of that server may be spread across multiple mainframes. Plus, that server may be redundantly replicated at multiple physical locations all around the world. So, there is almost no way to ever lose data or have your system crash. Because if the server farm in Utah goes down, your website will automatically reroute to the duplicate data center in Tennessee or Germany or Japan or wherever the other server farm happens to be located.
WHAT LANGUAGE DOES YOUR PLAN SUPPORT?
Depending upon what language you are using to build your website, you may need a specially configured web host to allow your code to run.
For example, simple and basic HTML, which is the language all websites are based upon, doesn't require any special configuration. HTML will run anywhere.
PHP is a special language which requires a PHP-based server, typically running on a Linux operating system. If a shared-hosting plan says it's using Linux servers, that usually means you can build a PHP site on there, without any problems.
Languages such as ASP.NET or NodeJS are also special types of code that will not function on any web server. You need to make sure the web hosting plan you are purchasing is able to support the language you want to use.
That covers all the basics of hosting...
So, you know the difference between a registrar and a web host..
Now, I don't mean to confuse you, but...
There is one very important note about registrars and web hosts.
Over the past few years, since around 2010 or thereabouts, many of these companies have started offering the services of the other. In other words, 15 years ago, you bought a domain from a registrar and you bought server space from a web host. These days, you can register your domain name through many web hosts and you can also host your website at most registrars. This is very convenient for people, because now you only have to deal with one company instead of two. But, it can also be very confusing when you are trying to learn how to do this stuff, because you aren't sure - am I dealing with a registrar to purchase my web hosting or a web host to register my domain?
Again, I can't tell you what to do for your projects. That choice is up to you.
Personally, I use a separate registrar and a separate web host. Mainly because that's the way I've always done it and I see no advantage to moving everything to one company. But, I also have another reason. Remember I said I had a former registrar go out of business? Well, thankfully, none of my websites went down, because they were hosted at a different company. All I had to do was make sure I pointed my domain names to a new DNS. I didn't need to actually move the websites themselves. Obviously, if my registrar company had also been my web host company in that situation, I would have had to do a lot more work and I would have risked having my sites go offline.
Like I said, I prefer keeping my registrar and my hosting company separate. It's all up to you if you want them rolled into one or not.
Once you buy the rights to a domain name, and you purchase the web hosting plan, what do you do next?
HOW DO YOU MOVE FILES FROM YOUR COMPUTER TO THE WEB SERVER?
We know that a browser is used to view websites.
But how do you upload websites to the web servers in the first place?
Typically, when you are building a website, you will write the code on your computer, then upload it to the web server. This process of moving files onto the servers is called "file transfer protocol" or FTP for short. Some of the programs used to compose and edit website code actually have FTP features built right into the program. So, when you save the file on your computer, it will also be automatically uploaded to your web server. That can be a great way to work and it can be very efficient. Personally, I have used that type of software, but I also like keeping my FTP separate. I find it's also nice to gather your thoughts on your local machine and make sure everything is up and running properly, and then FTP all the files up when you are ready.
Honestly, having worked both ways, I can speak from experience and say, either way is fine. Having an integrated FTP in your code editing software or a separate standalone FTP program is just a matter of personal preference. Try both and do whatever you like best. When I was at Disney, we actually did both, depending upon the systems being used and the nature of the website.
For the purposes of these articles, I'm going to keep things separate, so you have a clearer understanding of the different functionality of the software. When you are learning a new skill, I think it's best to keep each skill distinctive and isolated. When you try to combine too many things at once, it gets confusing. So, when you need to upload files to your website, you will need a good FTP program installed on your computer. There are many FTP programs available and many of them can be downloaded from the Internet for free. During my career, I've probably used a dozen FTP programs. The one I have preferred to use over the past several years is called FileZilla. I will provide a download link at the end of this article to the FileZilla website.
When you purchase a hosting plan from a web host, they will give you a special address to enter into your FTP program. This address accesses a kind of "behind-the-scenes" area of your website. Your audience, coming to see your website, uses a browser to get to their theater seats. You use FTP to access the backstage area and set everything up to give them a show. You will also choose a username and password for your FTP account, so no one else can gain entrance to your FTP area. Using your FTP software, you will be able to upload files from your computer to your website, download from your website to your computer, or delete files off of your website.
So, to summarize, websites were created to share and link documents and information.
The foundational code of websites is called HTML.
Before you can build a website, you purchase a domain name from a registrar, then you own the rights to that name. Paying for that registration simply grants you the ownership of the domain name. Nothing more.
To actually upload your website to the Internet, you need to purchase web hosting from a web hosting provider.
Some registrars also offer web hosting plans.
Some web hosts also offer registrar services.
Finally, you need to use an FTP program to upload, download or delete files, from your website.
That ends the "computer basics" for these articles. Hopefully, if you are new to computers, you now feel a lot more adept and comfortable navigating around a computer system. Remember it's really difficult to break anything on a computer. Not impossible, but really difficult. So, feel free to explore. Poke around. Check out different features. Look up functions of the operating system. Discover quirks in software programs. Get comfortable with using basic programs like calculators and word processors and photo editors and that will allow you to be more relaxed and comfortable when you learn more sophisticated software.
And remember, kids, the world owes you nothing... until you create things of value.
cloudA trendy name for a server-farm or data-center.
dedicated-hostingA hosting plan where one customer uses a single physical computer in a data center to store their website files. More expensive than shared-hosting.
domain registrarsCompanies who will register you as the owner of a domain name.
domain registrationThe process of purchasing the rights to own a domain name.
FTPAn abbreviation for "File Transfer Protocol" and is the process of uploading, downloading or deleting files from a web server.
hosting planThe services plan offered by a web hosting company.
HTMLAn abbreviation for "Hypertext Markup Language" and is the basis for all website code.
search enginesSpecial websites which index and catalog all data, on all webpages, all around the Internet, to help users find relevant websites.
shared-hostingA hosting plan where multiple customers all use a portion of a single hard-drive to store their website files. Cheaper than dedicated-hosting.
virtual machinesSoftware-based computers, that behave like a dedicated-host, but are running across multiple computers, possibly in different geographic locations.
web hostA company providing storage space for website files.