Do you know how to host a static site? In this article, we will learn what is a static Site, your composition, what is the choices to host them and how to do that! So, let’s see it!
What is a Static Site?
A Static Site is one or more pages constructed just with client size technologies. That is, a Static Site, don’t contain dynamic content, like scripts from server or PHP files. In other words, the content of a static site is the same for all visitors. That isn’t a server-side programming language. Everything is done in the Browser!
The Static Sites are usually constructed for contents that don’t need frequent updates.
The Advantages and Disadvantages of a Static Site
A static site has some advantages:
- They are cheaper because don’t need many resources from the server.
- They don’t need any programming code or database to work.
- Because of that, they don’t have any programming code vulnerability. So, they have more security.
- They usually have more performance. This is because they need to make fewer requests to the server.
On the other hand, they have some disadvantages:
- To update or make edits to the pages, you need to do this manually;
- their dynamic functionality is limited. This happens because it is necessary to add those functionalities separately;
- They don’t have a database, which makes data processing difficult.
How can I host my Static Site?
There are different ways to host a static site
If you don’t need any special resources, if you just like to make tests or put some pages online, you can use some platforms. One of these platforms is GitHub and GitLab, where you can host your static site for free.
You can use the S3 service of Amazon AWS (Amazon Web Services) to host your static site. Another way is with the Microsoft Azure Storage where you can see the Blob service. Also, the Google Cloud Platform offers one way to host your static site too.
You may find some ways and some services to host a static site. But, the most recommended is to obtain a Web Hosting Plan!
So, let’s see how to host your site on a web Hosting Plan.
What do I need to host a Static Site on Web Hosting?
The first step to host a static site is registering a Domain Name and obtain a Web Hosting Plan of your preference.
At Copahost we offer several hosting services to meet any needs you need, with quality and safety! We have the best Plans for you! And you can obtain your Domain Name with us too! Come to see our best plans!
After these steps, you will be able to upload files from your website to your Server!
How to Host a Static Site on my server?
In your server, you can put so many files. The files of your Website have to be on the directory: “public_html“. In some servers, this directory has the name: “www“. That is the root directory responsible for your website.
Therefore, you must upload all files from the site to that directory.
How can I upload my site to the server?
You can upload your site in different ways. But, don’t forget, the principal HTML or PHP file responsible for your homepage must have the name “index.html” or “index.php” and be located exactly in the “public_html” directory, not in its subdirectories.
Also, you can use SSH (Secure Socket Shell) to upload your files. But, firstly you should know if your Hosting is apted for this service. With SSH The principal difference of SSH for FTP is you can uncompress a file directly on your server. With that, you don’t have to do the unzip manually.
A very common way to upload files to the server is through a Web Hosting Control Panel. Some hosting servers use cPanel or DirectAdmin control panels. However, there are also those that use other panels or their own panel. Regardless, most parts of the servers allow you to upload files directly through this panel, using a file manager.
Finally, how you can see, there is so different way to host your Static site, choose the one you liked.
How can I upload my site in CopaHost?
CopaHost uses the DirectAdmin Control Panel. So, when you login, you will find a panel like this image:
choose the menu “System Info & Files” and nextly choose the option “File Manager“:
After, you should find the public_html directory. Click on it to go to this directory.
Here you can see your site’s files. Now, click on Upload File, and then, select or grab your site files here.
Copahost’s control panel also allows you to edit an HTML, PHP, JS or CSS files on it, without having to upload files. For that, you should mouse hover on your file, then choose the option “Edit File“:
Now, you can edit your file in this page! To save, just click on the “save” button.
The result of the above code in the browser will be as follows:
What Host is better for me?
Firstly, you must verify what is your needs. It is, what configurations your server must have to support your website. That depends on the size of your website, how much access should you have, what type of recourses do you need and so many things. In most cases of static sites, a Shared Hosting Simple plan is sufficient. But, for some needs, you must choose other options.