Host a static website with EOS
Introduction
In this tutorial, we will show you how to host a static website on EOS S3 Bucket, individual webpages include static content, and they might also contain client-side scripts which can be hosted on an S3 Bucket. Server-side scripts such as PHP, JSP, or ASP.NET is not supported on EOS S3.
Create Bucket
-
Go to Products > Storage option in the sidebar menu.
-
Click on Create New Bucket or the (+) icon.
-
Enter a unique bucket name. You must follow these guidelines when choosing the bucket name:
- You must enter a bucket name that is unique across all existing buckets in E2E Object Storage. You cannot choose a name that is already in use by another user.
- Names can not be changed after creation, so choose wisely.
- Bucket name must be at least 3 and no more than 63 characters long.
- Upper case letters or underscores are not allowed.
- Do not format bucket names like an IP address (e.g.,
10.10.10.2
).
-
Click Create.
-
You will be redirected to the object browser.
You will not be charged for empty buckets.
Now that your bucket is ready, you may choose to Upload files through the object browser or set bucket permissions to enable CLI access.
Add Permission to Your Bucket
Once you have created a bucket, you need to provide public access to your bucket.
-
Select the bucket you have created.
-
Click on Permission and select the Make Public option.
-
Select your type of access role (Upload/Download) and click on Save Permission.
-
The contents of your bucket will now be available for public access using the object path prefixed by the following URL:
https://objectstore.e2enetworks.net/Your_Bucket_Name/
.
Create Distribution with CDN Service
Once you have created a bucket, you need to create a distribution on CDN to get the distribution URL.
- Go to Other Service > CDN Service option in the sidebar menu.
- Click on the Create Distribution icon.
- Enter the following options.
Origin Domain Name (example.com*) - objectstore.e2enetworks.net
Origin path (E.g: /static) - /your_bucket_name
Origin ID - objectstore.e2enetworks.net
-
Enter your Origin, Cache, and Distribution settings.
tipYou can refer to the tooltip on the left side of each option to get information about your options.
-
Once all the settings have been entered, click on Create Distribution.
NoteCreation of the distribution will take around 10 to 15 minutes.
-
After creating the distribution, you can access your bucket content using the Distribution URL. Create a respective alias for this URL in the DNS panel to access your website with your domain.