Free Hosting at Amazon Web Services

This blog would not be possible without web hosting. There are numerous providers that will host websites for a monthly fee of around $10 (USD). All of them serve the website. A static website does no need a server. It simply requires a “parking spot” with a URL. Some people have tried using their “public” areas on their cloud accounts as parking spots. Dropbox did not like this practice and took action to prevent it, i.e., it doesn’t work. At this time the method does work with Google Drive and Microsoft OneDrive but it is not encouraged. Note that these remote drives are servers. On the other hand, Amazon is actually is actually inviting people to try their services at no cost for a year. The service that I will discuss is the s3 service. S3 is an abbreviation for Simple Storage Service. It is provided without a server. It is simply a storage space on the web with a URL, and that is exactly what is needed. Amazon calls the spaces buckets. You can have more than one bucket, in fact you can have up to 100! Amazon offers over 200 services so finding the s3 service and setting it up requires some searching. It is somewhat difficult. Despite the difficulties, once setup, posting and maintaining a website is very easy and the effort is very worthwhile.This is not a tutorial. I am going to tell you what to expect with a few tips from my personal experience.

Searching on (link) there is a tutorial on setting up a static website. Find it and print it out. It is 8 pages. Going through the lengthy setup process you will create a Bucket Policy. The tutorial provides a sample for static websites. Make a copy of this prior to the actual setup, so all you will need to do is a simple copy and paste. At the end of the process you will have a bucket with a somewhat clumsy “endpoint” URL. Of course before creating a bucket(s) you have to create an account.

To create an account go to (link) . Ask for an s3 account as a root user. You will provide a name and password for the account. You will be asked for some information on your geographic location. Amazon will provide you with a region code that identifies the computer that will host your bucket. My code is us-east-2. Next, you are provided with two alphanumeric strings. Amazon calls them the Access Code and Secret Key. You have a one time opportunity to download the keys as a CSV file. DO IT!!! Finally, you are given your login information. Exit the account setup and login with your credentials. You will have to solve some trick CAPTCHAS, Fortunately, if all goes well, this may be the only time you need to login. Create your bucket(s).

You will access and control the contents of your bucket with the Amazon Web Services Command Line Interface app AWSCLI. There are two versions. Version 2 is 64 bit only. On the RPi, 32 bit mode, you will need version 1. Amazon refers to some download scripts that do not work!! Instead simply issue the command sudo apt install awscli and ignore the warnings that this is an older version. Next issue the command aws configure. This is where you enter your credentials. There are only 4 entries. The first is your region code, the next two are your keys, and the last ignore for the default, The hard part is the keys. The access code is all caps. The secret key is longer with both caps, lower case and digits. Have fun!

Finally, you need to know the syntax of the aws command to upload your website. The Amazon documentation gives a handful of commands to control the contents of your bucket. The essential command to upload your website is aws s3 sync . s3://bucketname. Let’s break that down, The first parameter s3 identifies the service. The second parameter sync is the operation to be performed. The third parameter is the directory to be uploaded. Assuming that on your computer you have navigated to your sites contents, the single period . indicates the current directory. The last parameter identifies the specific button.

Yes, there is significant setup time here. I invested at least 12 hours. Some of that time was correcting mistakes. The effort was worth the time. Now, after composing a post, Hugo outputs it to the public folder. I enter that folder and issue the aws sync command, That’s it!

Again, the tutorials are at Amazon. This article gives you some tips should you choose to follow them. That said, I may be able to help you via the comments.

Hits