Nov 09

I know…what a title…could I have added a few more acronyms!

This is Amazon’s help page which is pretty good but does not give you the details of actually creating a Linux EC2 instance to use. So first off log into the AWS portal, select EC2 and launch a new instance. I’m going to give you specific instructions for Ubuntu Server 14.04 which I feel is the easiest; you can use any version of Linux but remember the installs commands are different.

Once logged into AWS select the EC2 option and:
Select a Micro instance and click Next:Configure Instance Details

Keep all the items default with the exception of admin IAM role if you have one if not I’d suggest you create one now. The process is here!

Click Next: Add Storage keeping all settings default then click Next: Add Tags.
I would suggest adding a key similar to below but that is up to you.

Click Next: Configure Security Group and either create a new security group to allow the needed ports or select something you already have. I keep a group called MyDMZ that has my entire basic web and SSH ports with the SSH set to my local IP address only.

Click Review and Launch and then Launch from the review screen. Once you do this you are presented with the select key pair dialog. Select an existing or create a new key pair. This is required to connect to the instance via putty or SSH so make sure you have it saved. When ready click the Launch Instances button.

Once the server is built SSH into it and update Ubuntu, install Apache, MySQL and PHP at a minimum and remember the accounts you are asked to create.
Commands are listed below:
sudo su
apt-get update
apt-get upgrade –y
apt-get dist-upgrade –y
apt-get autoremove –y
apt-get install apache2 –y
apt-get mysql-server –y
apt-get phpmyadmin –y

After all this is installed you have to modify a few things…
Edit the apache config:
nano /etc/apache2/sites-enabled/000-default.conf

Add this line:
Include /etc/phpmyadmin/apache.conf

Save the config and restart apache:
service apache2 restart

Leave the SSH session open for now, you still need it!

After all this go to the public IP address in a web browser and verify phpmyadmin is setup.
http://yourpublicIP/phpmyadmin

Log into the local instance with your root id and password:
Return to your SSH session and modify the phpmyadmin config to point to your RDS instance.
nano /etc/phpmyadmin/config.inc.php

Add the lines below to the PMA config area just above the /* Authentication type */ and fill in your RDS instance details to the __FILL_IN_DETAILS_ areas.

$i++;
$cfg[‘Servers’][$i][‘host’]          = ‘__FILL_IN_DETAILS__’;
$cfg[‘Servers’][$i][‘port’]          = ‘3306’;
$cfg[‘Servers’][$i][‘socket’]        = ”;
$cfg[‘Servers’][$i][‘connect_type’]  = ‘tcp’;
$cfg[‘Servers’][$i][‘extension’]     = ‘mysql’;
$cfg[‘Servers’][$i][‘compress’]      = FALSE;
$cfg[‘Servers’][$i][‘auth_type’]     = ‘config’;
$cfg[‘Servers’][$i][‘user’]          = ‘__FILL_IN_DETAILS__’;
$cfg[‘Servers’][$i][‘password’]      = ‘__FILL_IN_DETAILS__’;

The host info will be your endpoint FQDN address which can be found in the details section of your DB Instance. See below for an example.

Once this is saved go back to the PHPMYADMIN and select the RDS server from the Current Server pull down.

Now you can see and edit all tables and DB settings!

 

 

 

Leave a Reply

preload preload preload
Skip to toolbar