In this tutorial you will learn how to create a static website using Swift on Fuga Cloud. Static websites are more secure, the website loads faster and are highly scalable.
For this tutorial you need the following:
Step 1 - Create Team credentials.
- Login to your Fuga Cloud account and go to Access > Credentials. Select on the op of the screen ‘Team credentials. Create a new Team credentials by clicking on the orange ‘Team credentials +’ button.
- A window will appear with the credentials Username and Password, securely store the password in your password manager click on ‘Ok’.
- After creating the new Team credentials, click on ‘OpenRC’ and download the file on your device.
Step 2 - Create Object Store
(you can read more regarding our Object Store at our website)
Open your CLI client and follow the instructions below:
- When prompted, enter your previous saved password:
Enter password for TEAM Credential with ID <PROJECT_ID>
- Instal the swift client on your machine.
sudo apt install python3-swiftclient
- Create a container with public read access rights:
swift post -r '.r:*' <CONTAINER_NAME>
- Upload your html file:
swift upload <CONTAINER_NAME> index.html
- Set an index file directive:
swift post -m 'web-index:index.html' <CONTAINER_NAME>
- Turn on listing and set public read access rights:
swift post -r '.r:*,.rlistings' <CONTAINER_NAME>
swift post -m 'web-listings: true' <CONTAINER_NAME>
- Upload your html error file
swift upload <CONTAINER_NAME> <HTML_ERROR_FILE>
Set an error file:
swift post -m 'web-error:error.html' <CONTAINER_NAME>
Step 3 - Connect to the website
Go to the Fuga dashboard and go to Storage > Object store. Find your container and click on the three dots "...", and click on 'View Details'. You will get the information of your Container. Copy the Swift URL and past it in your browser to connect with your Static website.
Below you can see an example of an URL:
An alternative address is also available with the following URL syntax:
In this tutorial you have learned how to set up your team credentials, upload your index.html file and set up a static website in Fuga Cloud.