Table of Contents | |||
Long Term Support Stable, tested ServerTemplate assets |
|
To set up an example LAMP (Linux, Apache, MySQL, PHP) all-in-one server with your own application and database in a public/private cloud that can be used for production purposes because it supports continuous backups.
This tutorial describes the steps for launching a production-ready LAMP server in the cloud.
Before starting the tutorial it's strongly recommended that you read the LAMP All-In-One with MySQL 5.1 (v12.11 LTS) - Overview or LAMP All-In-One with MySQL 5.5 (v12.11 LTS) - Overview page, which will provide a technical overview of the ServerTemplate's overall functionality.
The ServerTemplate is designed to retrieve your MySQL database dump file from a supported Remote Object Storage (ROS) service. Currently, the ServerTemplate only supports the retrieval of a MySQL dump file from either an Amazon S3 bucket or Rackspace Cloud Files container.
If you do not have your own dump file you can use the following sample MySQL dump file to complete the tutorial. The sample is a gzip (.gz) file.
Alternatively, our services team provides another sample PHP application and MySQL database dump file listed below. The link below for the application code downloads a .tar.gz tarball file for you directly from Github. The database dump is the 'world' test database provided directly by MySQL.
Credentials are a way of passing sensitive information to a script (as an input) in a discrete manner without making the actual value visible in the Dashboard. As a best practice, many of the ServerTemplates published by RightScale are preconfigured to use certain credentials. The ServerTemplate assumes that you are following best practices and using credentials to store sensitive information. If the following credentials do not already exist in the RightScale account, you should create them now. Requires 'designer' or 'admin' user role privileges. See Create a New Credential.
If you do not want to create credentials for storing these values, you can enter them as text values later in this tutorial when you define the inputs.
The next step is to define any missing inputs. It's recommended that you define any missing inputs at the deployment level for inheritance and consistency reasons.
This particular ServerTemplate contains scripts that retrieve a MySQL dump file and application code at boot time. In order for the scripts to successfully retrieve the files you will need to provide necessary information.
Under the deployment's Inputs tab, click Edit.
Click the Show all Advanced text link to view the exhaustive list of inputs for all categories.
You can retrieve your database dump from one of the following locations:
Input Name | Description | Example Value |
Database Schema Name | The database name/schema of the MySQL dump file. | text: my_schema
For the optional 'world' database mentioned above, use the value:
text: world |
Dump Container | Enter the name of the Amazon S3 bucket or Rackspace Cloud Files container that contains the MySQL dump file to be installed on the instance. | text: db-bucket |
Database Schema Name | The database name/schema of the MySQL dump file. | text: my_schema
For the optional 'world' database mentioned above, use the value:
text: world |
Dump Prefix | The prefix name that will be used to create new database backups or locate a previous backup. For example, if you are using an existing dump file called 'app_test-201109010029.gz' specify 'app_test' as the Dump Prefix. You can also enter the fullname of a dump file without the file extension. (e.g. app-test-201109010029) | text: my_db_prefix
For the optional 'world' database mentioned above, use the value:
text: world_innodb.sql |
Dump Storage Account ID | Used for authentication purposes when retrieving the database dump file from the specified Dump Container. Required to retrieve a private object from the dump container. | cred: AWS_ACCESS_KEY_ID cred: RACKSPACE_USERNAME |
Dump Storage Account Provider | Select the Remote Object Store (ROS) provider where the database dump file is currently stored. Select 'S3' for Amazon S3. | text: S3 text: CloudFiles |
Dump Storage Account Secret | Used for authentication purposes when retrieving the database dump file from the specified Dump Container. Required to retrieve a private object from the dump container. | cred: AWS_SECRET_ACCESS_KEY cred: RACKSPACE_AUTH_KEY |
You can retrieve application code from one of the following locations:
Under the "REPO" input category, use the following input to specify where the application will be retrieved from.
Input Name | Description | Example Value |
Repository Provider | Select which repository provider contains the application code.
| text: repo_git |
Provide values for the following inputs if you are pulling application code from a Git repository.
Input Name | Description | Example Value |
Repository URL | The url of the git repository that contains the application code. For a public repository, use the HTTP or Git Read-Only url. (e.g. git://github.com/username/repo_name.git) Note: If you are retrieving code from a private repository, you must use the SSH url. (e.g. git@github.com:username/repo_name.git) | text: git://github.com/username/repo_name.git text: git@github.com:username/repo_name.git
For the optional sample application mentioned above, use the value:
|
Repository Branch/Tag/Commit | The name of the repository branch, tag, or SHA. | text: mybranch
For the optional sample application mentioned above, use the value:
text: master |
SSH Key | Used for authentication purposes when retrieving the files from the specified repository. To retrieve code from a public repository, set to 'Ignore'. Required to retrieve files from a private GitHub repository. It's recommended that you create and use a credential for the key. (e.g. GIT_SSH_KEY) | cred: GIT_SSH_KEY
For the optional sample application mentioned above, use the value:
No Value/Ignore |
Provide values for the following inputs if you are pulling application code from a Git repository.
Input Name | Description | Example Value |
Repository URL | The url of the svn repository that contains the application code. For a public repository, use the HTTP or Git Read-Only url. (e.g. http://mysvn.net/app/) | text: http://mysvn.net/app/ |
SVN password | The password of a user with access an SVN repository. Used for authentication purposes when retrieving the files from the specified repository. | cred: SVN_PASSWORD |
SVN username | The username of a user with access an SVN repository. Used for authentication purposes when retrieving the files from the specified repository. | cred: SVN_USERNAME |
Provide values for the following inputs if you are pulling application code from ROS. (e.g. Amazon S3 or Rackspace Cloud Files)
Input Name | Description | Example Value |
ROS Container | Enter the name of the Amazon S3 bucket or Rackspace Cloud Files container that contains the tarball of the application code that will be installed on the instance. | text: my-app-bucket |
ROS Prefix | The prefix name that will be used to locate the application tarball. Only zipped tarballs are supported. (*.tgz) For example, if you are using an existing dump file called 'php_unified.tgz' specify 'php_unified' as the ROS Prefix. Do not include the file extension. | text: my_app_prefix |
ROS Storage Account ID | Used for authentication purposes when retrieving the application tarball from the specified ROS Container. Required to retrieve a private object from the ROS Container. | cred: AWS_ACCESS_KEY_ID cred: RACKSPACE_USERNAME |
ROS Storage Account Provider | Select the Remote Object Store (ROS) provider where the application tarball is currently stored. Select 'S3' for Amazon S3. | text: S3 text: Cloud Files |
ROS Storage Account Secret | Used for authentication purposes when retrieving the application tarball from the specified ROS Container. Required to retrieve a private object from the ROS Container. | cred: AWS_SECRET_ACCESS_KEY cred: RACKSPACE_AUTH_KEY |
When you are finished defining the inputs, click Save.
Now that you have finished defining server details, you are ready to launch a server in the cloud with the new settings. Go back to the Servers tab and click the server's Launch button.
Review the inputs that you set at the Inputs confirmation page and click Launch.
After the server enters the operational state, you can test it to ensure that it was properly configured. To test your server, go to the server's Info tab. You can either copy and paste the server's public IP address into a web browser or click the public DNS name or IP address link (if available).
When you navigate to your running LAMP server in a web browser, you will see your application's default page.
Troubleshooting
If the server is operaional but you cannot view the test page in a browser window, make sure your server's security group has port 80 open.
You should also click on the server's Monitoring tab to view real-time monitoring graphs and check out the detailed server information under the Audit Entries tabs.
When you finish testing, click Terminate to terminate the server.
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.