Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > ServerTemplates > v12.11 LTS > ST > LAMP All-In-One with MySQL 5.1 (RSB) (v12.11 LTS) > LAMP All-In-One with MySQL 5.1 (RSB) (v12.11 LTS) - Tutorial

LAMP All-In-One with MySQL 5.1 (RSB) (v12.11 LTS) - Tutorial

 


Table of Contents    

Long Term Support

icon-lts-v1.png

Stable, tested ServerTemplate assets

     ►   Tutorial

Objective

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.

Prerequisites

  • 'actor', 'designer', and 'library' user role privileges
  • Access to a MySQL 5.1 dump file that is located in either an Amazon S3 bucket or Rackspace Cloud Files container.
  • PHP application code that is accessible through a Git or SVN repository, or as a tarball (.tgz) saved in either an Amazon S3 bucket or Rackspace Cloud Files container.
  • For Amazon EC2, CloudStack, and other clouds that support security groups, you must have a security group defined with TCP port 22 open for SSH access and port 80 for client HTTP access.

Overview

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. 

Steps

Upload your database dump file

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.

Add a Server to a Deployment

  1. Create a new deployment. See Create a New Deployment.
  2. Go to Design > MultiCloud Marketplace > ServerTemplates. Import the LAMP All-In-One with MySQL 5.1 (RSB) ServerTemplate.
  3. You can use the published revision of the ServerTemplate to launch your LAMP server. However, if you plan to customize the ServerTemplate, clone the template to create an editable version that you can modify. See Clone a ServerTemplate.
  4. Add a server to the new deployment using the imported (or cloned) ServerTemplate. See Add Server Assistant for details. 

Create 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. 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.

  • DBAPPLICATION_PASSWORD - Password of a database user with user-level privileges.
  • DBAPPLICATION_USER - Username of a database user with user-level privileges.
  • RACKSPACE_USERNAME - (Optional) Recommended if you are retrieving a database dump file from a Rackspace Cloud Files container.
  • RACKSPACE_AUTH_KEY - (Optional) Recommended if you are retrieving a database dump file from a Rackspace Cloud Files container.

Define 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.

screen-ShowAdvancedInputs-v1.png

Retrieve Application Code

You can retrieve your application code from one of the following locations:

  • Amazon S3 bucket
  • Rackspace Cloud Files container


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.
Select 'cloudfiles' for Rackspace Cloud Files.

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

Retrieve Database Dump

You can retrieve your database dump from one of the following locations:

  • Amazon S3 bucket
  • Rackspace Cloud Files container


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.
Select "CloudFiles for Rackspace Cloud Files.

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.

Launch the Server

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.

Post Tutorial Steps

Test the Server

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).

  • For an Amazon EC2 server, click the "Public DNS name" link (see the following screenshot)
  • For servers launched in other clouds, use the "(Public) IP Address"

 

screen-ServerOperational-v1.png

When you navigate to your running LAMP server in a web browser, you will see application's default page. 

Terminate the Server

When you are finished with your testing, terminate the server by clicking its Terminate button.

You must to post a comment.
Last modified
10:26, 12 Jul 2013

Tags

Classifications

This page has no classifications.

Announcements

None


© 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.