Create your first website on Cloud Servers quickly
The Rackspace Cloud can save you both time and money. This guide shows you how to do both by explaining the basic process of turning your idea into a working site in three basic steps:
- Build the infrastructure
- Upload your code
The project that you’re bringing to the cloud is probably much more complicated than what this guide covers. However, the process that this guide uses applies to the successful deployment of any web site or application.
This guide is not a comprehensive tour of Cloud Servers. However, by following these instructions, you are establishing the fundamentals that you can build on by reading future articles and guides.
The information in this guide is practical, so if you plan to follow along step by step, you might need to download and install the following software:
- an SSH client application
- an SFTP client application
If you don’t have a website to upload, you can use an HTML file created for this exercise. Download it here (right-click to save the file).
Build the infrastructure
In this section, you create your server, connect to it, and install the Apache web server package to turn the server into a web server.
Create a cloud server
Log in to the Cloud Control Panel, using the user name and password that you entered when you created your account.
The control panel supports many Rackspace products and services. Each component of this interface, and all of our products and services, are explained in other articles and videos (for example, Introducing the Cloud Control Panel). This guide focuses on deploying your first cloud server.
In the top navigation bar, click Select a Product > Rackspace Cloud.
Select Servers > Cloud Servers and click Create Server.
In most cases, you can deploy the right infrastructure with just a few clicks.
You have a large amount of control when creating a new cloud server, but, to keep things simple, this guide focuses on the three required parts: name, image, and size.
Name your Cloud Server.
The name of your cloud server should communicate its role (for example, web server or database) and what it’s hosting.
Select an image.
The image that you select contains both the OS and preselected software.
Select a flavor.
Flavor refers to the server’s capacity for CPU, RAM, and hard drive. You can think of flavor as the “size” of the server. When you need more power, you want to select a “bigger” Cloud Server, so you select a higher capacity flavor. Because this is a test server, save some money and select the 1 GB General Purpose flavor.
Click Create Server.
A pop-up window is displayed with your server’s Root Admin Password. You need this password to connect to the server later in this guide, so copy it before you click Dismiss Password.
Verify that the build is complete.
The time it takes for your cloud server to build depends on the image and flavor that you selected. The server is finished building and is ready for a connection when the Server Status is Active.
Copy the public IP address.
Now that you have an active cloud server, you need to make it a web server. You do this by connecting to it and installing the Apache web server package. You use the server’s IPv4 address (PublicNet), which you can find in the Networks section of the server’s detail view. Copy the address for later use.
Connect to your server
You can connect to a server in several ways, but the standard and most secure method is called Secure Shell, or SSH. It allows you to send information to and from your server in a secure fashion.
- Connect from either a Mac OS X or Windows Computer.
Connect from Mac OS X
You can connect to your cloud server from a Mac OS X computer by running the
sshcommand in Terminal.app or the SSH client you downloaded that at the beginning of the guide. You can find the command to use SSH in the right-side bar of the server detail page of the Cloud Control Panel.
Copy this command and paste it into your terminal, or click it and Terminal.app opens for you.
Connect from Windows
You can use an SSH client to connect to your server from a Windows computer. For instructions that use the PuTTY SSH client, see Connecting to Linux from Windows by using PuTTY.
The first time that you connect to a cloud server, your computer verifies that this is something you want to do.
Type yes and then press Enter.
Type or paste the password that you copied in step 6 when you created the server.
If the password is correct, you connect to your server. You will see a screen similar to the following one:
To install Apache, enter the following command in the terminal window:
apt-get install apache2 -y
Some information scrolls by in your terminal window. This is your server downloading and installing Apache and any software Apache might need to operate correctly.
Test Apache with your web browser
After the command is finished running, ensure that Apache is installed and turned on. Put the (PublicNet) IPv4 address of your cloud server into a web browser. If you see the message “It works!”, you now have a web server installed on your cloud server.
This “It works!” site file is stored as
index.html in your
Upload your code
The next step is to upload your site. You might be familiar with File Transfer Protocol (FTP) as a way to upload files to and download files from another computer. Rackspace Cloud Servers uses SSH File Transfer Protocol (SFTP) for added security, so you need an FTP client that will support an SFTP connection. Fortunately, many of the popular and free FTP clients do this.
Common steps to establish an SFTP connection with your server
- When you create a new connection, be sure to choose the SFTP (SSH File Transfer Protocol) option.
- For the server, type the IP address of the cloud server.
- For the username, enter
- For the password, enter the root user’s password.
- Click the option to establish the new connection to your server.
Upload your site
If you haven’t already downloaded the sample HTML file, download it from here.
You should not upload the HTML file just anywhere on the Cloud Server. Apache is configured to look in a specific directory for content to serve on the web. This special directory is referred to as the DocumentRoot.
On an Ubuntu server, the DocumentRoot is located at
/var/www, so upload your
site file to that directory. Navigate to that directory in your SFTP client, then
replace the existing index.html file with your file.
Test your site
Now that the correct HTML file is uploaded to the correct directory, you should see your site when you refresh your browser.
Congratulations! In a short period of time, you deployed a cloud server, connected to it via SSH, installed the Apache web server, uploaded a new HTML file to the server’s DocumentRoot directory, and tested the site in a web browser.
Several resources are available to help you progress:
- Rackspace How-To - Information about all Rackspace products
- Cloud Launch Guides - Step-by-step guides on how to build and deploy cloud services
- The Rackspace Community - Discuss ideas with Rackers and other customers
- Fanatical Support®
Continue the conversation in the Rackspace Community.
©2018 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License