How to Host a Static Site

How to Host a Static Site

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.

Currently, the mostly Static sites are constructed just with HTML, CSS, JavaScript, images and video files!

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:

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!

CopaHost 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.

A way to upload your site is by an FTP protocol. To do that, you can use an FTP client, like the Fillezila. With FTP client, you can upload your files to the server.

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:

DirectAdmin Control Panel

choose the menu “System Info & Files” and nextly choose the option “File Manager“:

DirectAdmin Control Panel -> File Manager

After, you should find the public_html directory. Click on it to go to this directory.

File manager -> public_html

Here you can see your site’s files. Now, click on Upload File, and then, select or grab your site files here.

File Manager -> Upload Files

Upload files

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 optionEdit File“:

Edit HTML files from file manager

Now, you can edit your file in this page! To save, just click on the “save” button.

Edit HTML Files of my static site in File Manager

The result of the above code in the browser will be as follows:

My HTML file Static Site Results

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.

CopaHost has so many Web Hosting plans for you! Take a look, certainly, you will find what you need!

Was this helpful?

Thanks for your feedback!

Rafael Marques

https://ialife.com.br/

Brazilian Web Developer and Writer!

Leave a Reply

Your email address will not be published. Required fields are marked *