We recently updated the Rackspace Control Panel to simplify setting up a Cloud Files static website. In this article, we’ll show you how easy it is to set up a static website using Cloud Files and the Control Panel.
Because Rackspace Cloud Files is an inexpensive way to store and distribute objects, the Cloud Files static website feature coupled with the lightning-fast content delivery network (CDN) is a winning combination in terms of both performance and price.
Creating a static website—a site that does not change for each request—with Cloud Files and the updated Control Panel is as easy as pointing and clicking.
To set up a static website using the Control Panel
In the Control Panel, you begin to set up your static website by creating a container.
1. Log in to the Control Panel at https://mycloud.rackspace.com.
2. In the Files section of the Control Panel, click Create Container.
3. Specify a name and region for your static website.
4. For Type, select Static Website.
5. Click Create Container.
Setting up a static website in the Control Panel automates the following Cloud Files API operations for you:
- Sets the index page to index.html for both the container and any pseudo directories within the container. (To change the index page to something other than index.html, use the Cloud Files API to update the metadata X-Container-Meta-Web-Index.)
- Sets your container to use CDN, so that your users can retrieve your content faster.
After your container is created, upload your content (the HTML pages, pictures, and videos).
6. In the Control Panel, click on your static website container, and then click the Upload Files button.
7. In the File Upload dialog box, click Choose Files and navigate to the folder with your content.
8. Select your content (you can select multiple files), and then click Open.
At this point, your static website container is set up and the content is uploaded to the container. Next, to access your static website, you need the CDN URL.
9. In the Control Panel, navigate to your container listing by clicking the Containers link.
10. Click the cog wheel next to your static website container, and then click View All Links.
All the CDN URLs for your container are displayed. For HTML pages and pictures, use the HTTP link for your static website container.
You can create a user-friendly URL by using a CNAME to translate your CDN URL to your own URL, such as http://www.example.com. You can learn more about using CNAMEs with the Rackspace DNS service.
Cloud Files has a flat structure (no directories), but you can emulate directory structures by using pseudo directories. Pseudo directories help you organize your content and use URLs the way you expect. For example, http://www.example.com/ sends you to the highest level index.html file, while http://www.example.com/folder1 retrieves the index.html file in the folder1 pseudo directory. You can learn more about how to use pseudo directories in the Cloud Files Developer Guide.
If you prefer using the Cloud Files API, or if you need the additional flexibility provided by the Cloud Files API, check out our previous static website blog entry.
With the updated Control Panel, creating a static website that delivers content over a CDN is as easy as pointing and clicking.
Rackspace will continue to add Cloud Files API functionality to the Control Panel, so stay tuned for other ways we are making it easier for you to leverage the power of Cloud Files while using the Control Panel.