Setting up Wordpress on AWS Linux with localhost mysql.

Config

  • Amazon AWS Linux
  • local Mysql

1. Create a free-tier EC2 instance on AWS.

Setup authentication public key(.pem). (optional)
Setup security group, enable inBound port 80 and 3306 for web and sql access.


2. Install APM(Apache, PHP MySQL) for Wordpress.

Login to EC2 using SSH.

sudo -i
yum install php
yum install mysql-server mysql
yum install -y php php-mysql
yum install httpd


3. MySQL Setup

Start up MySQL daemon and run sql client.

/etc/init.d/mysqld start
mysql

In MySQL, create a wordpress database and setup admin db admin user.

create database wordpress;
grant all on wordpress.* to wordpressU@'localhost' identified by 'wordpressP';
flush privileges;
exit

4.

service httpd start
wget https://wordpress.org/latest.tar.gz
cd /var/www/html
tar xzf latest.tar.gz
chown -R apache.apache wordpress #Check User and Group is set same - apache
service httpd restart