#Launch an instance http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.html
chmod 400 key.pem
ssh -i key.pem ec2-user@YOUR_SERVER_IP
-y will tell yum to say yes to all questions.
sudo yum -y update
sudo yum install -y gcc make gcc-c++
sudo yum install -y php55-mysqlnd php55 php55-xml php55-mcrypt php55-mbstring php55-cli mysql55 mysql55-server httpd24
Start your engines
sudo service httpd start
sudo service mysqld start
MySQL Setup
sudo /usr/bin/mysqladmin -u root password SUPERSECUREPASSWORD
Install phpMyAdmin
cd /var/www/html
sudo wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.1.7/phpMyAdmin-4.1.7-all-languages.tar.gz
sudo tar -xzvf phpMyAdmin-4.1.7-all-languages.tar.gz -C /var/www/html
sudo mv phpMyAdmin-4.1.7-all-languages phpmyadmin
sudo rm -rf phpMyAdmin-4.1.7-all-languages.tar.gz
check for updates: http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/
We now need to add a user and give that user permission for this folder:
sudo adduser phpmyadmin
sudo passwd phpmyadmin
After you set a password, find the user group (should be apache) with this command: egrep 'User|Group' /etc/httpd/conf/httpd.conf
Which will return:
User apache
Group apache
And last, run this command to associate that user with the phpmyadmin folder:
sudo chown -R phpmyadmin.apache phpmyadmin/
Install Config
cd /var/www/html/phpmyadmin/
sudo mkdir config
sudo chmod o+rw config
sudo cp config.sample.inc.php config/config.inc.php
sudo chmod o+w config/config.inc.php
Setup Config
sudo nano /var/www/html/phpmyadmin/config/config.inc.php
$cfg['blowfish_secret'] = '{^QP+-(3mlHy+Gd~FE3mN{gIATs^1lX+T=KVYv{ubK*U0V';Restart Server
sudo service httpd restart
Setup phpMyAdmin
http://YOUR_SERVER_IP/phpmyadmin/index.php
with username root password SUPERSECUREPASSWORD
#Setup RDS
Setup RDS with username awsuser password mypassword. Edit Config
sudo nano /var/www/html/phpmyadmin/config/config.inc.php
$cfg['Servers'][$i]['host'] = 'mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com'Access phpMyAdmin
http://YOUR_SERVER_IP/phpmyadmin/index.php
with username awsuser password mypassword
Test db connection
sudo nano /var/www/html/info.php
$link = mysqli_connect('mydbinstance.abcdefghijkl.us-east-1.rds.amazonaws.com', 'awsuser', 'mypassword', 'information_schema', 3306);
var_dump($link);$link = mysqli_connect('localhost', 'root', 'SUPERSECUREPASSWORD', 'test');
var_dump($link);#References:
- WORDPRESS ON LINUX IN THE AMAZON CLOUD WITH MAC - http://calebogden.com/wordpress-on-linux-in-the-amazon-cloud-with-mac
- phpMyAdmin Blowfish Secret Generator - http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator
thank you!
(you have a typo: "Git Depoly" should be "Git Deploy") 😄