Table of Contents | |||
Long Term Support Stable, tested ServerTemplate assets |
|
To set up an example LAMP (Linux, Apache, MySQL, PHP) all-in-one server in a public or 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 (RSB) (v12.11 LTS) - Overview, 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 need a sample PHP application and MySQL database dump file, our services team provides one from the following Github repository. The link below for the application code downloads a .tar.gz tarball file for you. The database dump is the 'world' test database provided directly by MySQL.
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. This action 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 to take advantage of the input inheritance rules and promote overall input consistency across all servers in the deployment.
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 the following 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 application code from one of the following locations:
Under the "Application" category, provide values for the following inputs.
Input Name | Description | Example Value |
APPLICATION | Provide the name of your PHP application. (ex: my_app) | text:my_app |
APPLICATION_CODE_BUCKET | 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 |
APPLICATION_CODE_PACKAGE | Enter the name of the application tarball file with its extension. Only zipped tarballs are supported. (*.tgz) | text:my_app.tgz
For the sample application listed above, use the full tarball .tar.gz filename from the download i.e., text:rs-services-rs_phpmysql_testapp.tar.gz |
STORAGE_ACCOUNT_ID | Used for authentication purposes when retrieving the application tarball from the specified APPLICATION_CODE_BUCKET. Required to retrieve a private object from the APPLICATION_CODE_BUCKET. | cred:AWS_ACCESS_KEY_ID cred:RACKSPACE_USERNAME |
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:cloudfiles |
STORAGE_ACCOUNT_SECRET | Used for authentication purposes when retrieving the application tarball from the specified APPLICATION_CODE_BUCKET. Required to retrieve a private object from the APPLICATION_CODE_BUCKET. | cred:AWS_SECRET_ACCESS_KEY cred:RACKSPACE_AUTH_KEY |
You can retrieve your database dump from one of the following locations:
Under the "Database" category, provide values for the following inputs.
Input Name | Description | Example Value |
DB_MYSQLDUMP_BUCKET | 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:mybucket |
DB_MYSQLDUMP_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:myprefix
For the sample database dump listed above, use the value:
text: world_innodb.sql |
DB_SCHEMA_NAME | The database name/schema of the MySQL dump file. | text:myschema
For the sample 'world' database mentioned above, use the value:
text:world |
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 |
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 |
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 |
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 those configuration settings. 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 application's default page.
When you are finished with your testing, terminate the server by clicking its Terminate button.
© 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.