Considering making the leap to install WordPress on AWS directly? Amazon Web Services (AWS) is the biggest provider for cloud hosting services, so it makes sense to consider trying it out.
Knowing how to install WordPress on AWS involves a bit more work than with other hosting providers. However, cloud hosting is quickly becoming standard for a lot of businesses. This means knowing how to navigate AWS can only benefit you and your website.
In this article, we’re going to teach you how to install WordPress on AWS in steps by steps . Let’s get to work!
What type of EC2 instance should you use? I started my experiments with a Micro instance because its price structure is very attractive. To create a new instance, access the AWS Management Console and click the EC2 tab:
Once your instance is running, you can ssh into it. First, you need to identify the address of your instance: Select the instance in the AWS Management Console, and look for the Public DNS in the instance description.
Use that address (and a path to your .pem file) to ssh into your instance:
ssh ec2-user@ec2-13-52-75-95.us-west-1.compute.amazonaws.com -i ~/royex.pem
If you get a message about your .pem file permissions being too open, chmod your .pem file as follows:
chmod 600 ~/royex.pem
Many of the shell commands below require root access. To avoid having to prefix these commands with sudo, let’s just switch user once and for all:
sudo su
To install the Apache Web Server, type:
yum install httpd
Start the Apache Web Server:
service httpd start
To test your Web Server, open a browser and access your web site: http://ec2-13-52-75-95.us-west-1.compute.amazonaws.com (Use your actual public DNS name). You should see a standard Amazon placeholder page.
To install PHP, type:
yum install php php-mysql
Restart the Apache Web Server:
service httpd restart
Create a page to test your PHP installation:
cd /var/www/html
vi test.php
-> Type i to start the insert mode
-> Type <?php phpinfo() ?>
-> Type :wq to write the file and quit vi
Open a browser and access test.php to test your PHP installation: http://ec2-13-52-75-95.us-west-1.compute.amazonaws.com/test.php (Use your actual public DNS name).
To install MySQL, type:
yum install mysql-server
Start MySQL:
service mysqld start
Create your “royex_db” database:
mysqladmin -uroot create royex_db
Secure your database:
mysql_secure_Installation
Answer the wizard questions as follows:
To install WordPress, type:
cd /var/www/html
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gzcd
This will uncompress WordPress in its own “wordpress” directory. I like having WordPress in a separate directory, but would rather rename it to “royex”:
mv wordpress royex
Create the WordPress wp-config.php file:
cd royex
mv wp-config-sample.php wp-config.php
vi wp-config.php
define(‘DB_NAME’, ‘royex_db’);
define(‘DB_USER’, ‘root’);
define(‘DB_PASSWORD’, ‘YOUR_PASSWORD’);
define(‘DB_HOST’, ‘localhost’);
Open a Browser and access your royex: http://ec2-50-17-14-16.compute-1.amazonaws.com/royex (Use your actual public DNS name). This should trigger the WordPress configuration process.
To use your “royex” in production, you will have to:
To associate an IP address to your instance:
The following steps show how to create a hosted zone and record set for your server or root zone.
Hope this gives an idea on how to create your own hosted zone and record set in Amazon route 53.
Royex Technologies is one of the leading companies in Dubai for designing cloud servers and maintenance. For all AWS consulting and services, choose Royex. To get started, call for any inquiries at +971566027916 or mail at info@royex.net