Web hosting is a means by which you can host your files or website on a computer, where you or everyone has access to it from all over the world; for example, an e-shop has a website hosted on a server, and you are able to access and interact with the server through your browser or your mobile phone. Thus, the web hosting is more about the server side, how you can save your files and serve them to anyone that requests them. To make this easier to understand, let's look the following image, where the client (computer) is requesting a website using his browser, and the server is responding back with the website:
As we can see in the preceding image, the client is requesting a website from the server and the server serves that webpage to the client; thus, we have two communication directions and two arrows. The user may be using a desktop PC or mobile phone; he may also be using Firefox, Google Chrome, or any other browser. The server is usually a big server building similar to the preceding image but can also be a small pocket-size Raspberry Pi Zero W board. The important thing is that we always have a client who requests things and a server ready to respond if of course the client is authorized to receive these files. In this chapter, the client will be us or anyone in the world, and the server will be our Raspberry Pi Zero W board. Now, let's see some options we normally have when we buy a hosting package.
Usually, the big hosting services have more than one solution. This is because we all have different needs. People have different needs; thus, almost everyone has different packages; for example, you may have a few MB of the total space, or have unlimited space and one database, or more features such as one click WordPress installation, and more. Depending on your needs, you obviously choose a service with the lowest cost for your company or your personal need. Next, you can see an image from Top Host displaying the hosting services they provide:
As you can see, there are four options: in the first, you have one dynamic site; in the second, five dynamic sites; in the third, unlimited; and in the last, you have everything. Obviously, not every hosting company provides all the services from the image but they all have the same logic. Generally speaking, if you want to host some files or a website of a total size < 500 MB, you should be fine and the cost is not too much. However, if you want to host a website for a company such as an e-shop or similar, you need to invest in a good server such as the preceding one. It should be clear that when you have a company, you do not host your e-shop on a Raspberry Pi Zero W board. It may work but you have zero user reliability or support.
Another thing to consider before completing your purchase is the selection of your domain name. As we will discuss in later sections, apart from web hosting, we need a domain name so that people can remember our website. Servers and, as a result, websites have an IP Address. This means that the facebook.com website has an IP address, such as 157.240.9.35. Imagine if there was no facebook.com and all users had to type 157.240.9.35 every single time they wanted to use the website. There is no way that the internet could have such dimensions as it has today using this kind of interaction with servers and requesting websites. To conclude, this is the reason that we came up with domain names; each website has a domain name that obviously is easier to remember since it consists of letters. Picking your domain name may be straightforward, but there are some things that you should consider before paying for it. As we said, a domain name is something similar to facebook.com, linkedin.com, vasilistzivaras.gr, or anything that makes your website unique in the world. There is no domain name that corresponds to two websites. First of all, it is important to know that a domain name is quite important for Search Engine Optimization (SEO). SEO means that the name of the website is a variable in the Google search algorithm. If we do not want to make it available to the internet and we need the website for personal use, that is OK and you probably do not have to buy a domain name, as I think that you can remember an IP address. However, if you are creating a website to be made available to the entire internet and adding it to Google's search engine result list, then the URL or the domain name should be something that really represents your website; for example, it is stupid to have a website about clothes with the domain name catsanddogs.com. At this point, I should say that many hosting providers give you free hosting for a small website when buying a domain name. This is how I, personally, have developed my website vasilistzivaras.gr.
Furthermore, it is important to introduce another term relevant to web hosting and domain names. We do not have to buy anything here, but it is crucial to know what a DNS does. We talked about web hosting, so there is a computer that hosts our files. We also talked about the domain name, so there is a URL or a name that corresponds to our server's IP address. When a client types our domain name in a web browser, the computer needs to know the IP address. So, a Domain Name Server (DNS) is a system that matches IP addresses with domain names. This is not something that we have to buy, but is something that we or our website administration needs to set up.
Now, let's see what happens after we buy a hosting service. At this point, you should have an IP address for your website, username, and password. You should go to the link that is contained in your verification email and after the login, you are prompted to pdesk or some other interface on which you can set up your hosting and domain names. I will define a list with the actions we need to perform and later on, in further sections, we will discuss solutions for this kind of action-issue. So, after buying a website, you need to:
- Transfer your files or website to the hosting server
- Set up DNS according to your domain name
If you are familiar with web development, you must have already come up with some questions. There are some issues born here; for example, how will we transfer the files to the hosting service? Usually, drag and drop works but not always, especially in our Raspberry Pi Zero W board but we will discuss this subject later. Next, how do we match the domain name with the server IP address? Furthermore, what if I want to make a minor change? Do I have to upload all the files again? As you can see, web hosting requires some experience and is not straightforward for many users out there. This is why many hosting services have a live support 24/7 and a ticket troubleshooting page.
Now that you know what web hosting is, you should have qu...