Home > Tutorials > How to install WordPress in the cloud

How to install WordPress in the cloud

Share on TwitterSubmit to reddit

Host WordPress in a cloud computing platform using an Amazon EC2 (Elastic Compute Cloud) instance as a free solution.

Following this tutorial you will be able to install WordPress, Apache and MySQL in a cloud computing platform provided by Amazon Web Services (AWS).

Before starting you should have your own AWS account. If it’s not the case, you can easily create it in http://aws.amazon.com/.

Note: You will have to provide a method of payment to create your AWS account. However there is no cost in the solutions showed in this tutorial. Amazon offers a free micro instance (free tier) in its cloud computing platform for one year. It might generate cost only if you use more resources than offered in the free instance. If it’s the case with your blog… congratulations! you will generate enough money to afford the extra resources.

Assuming you already have your AWS account, let’s begin! Two different solutions are going to be proposed to reach the goal of this tutorial, and both of them with no costs:

Solution 1: Create a new Amazon EC2 instance where you will install apache, MySQL, phpMyAdmin and WordPress.

  • Advantages: More customizable
  • Disadvantages: Time consuming to complete the tutorial (estimated 40 min)

Solution 2: Create an Amazon EC2 instance using a pre-configured BitNami AMI.

  • Advantages: Time consuming to complete the tutorial (estimated 10 min)
  • Disadvantages: The customization of the environment (modules, software versions, etc)

Solution 1:  Creating a new Amazon EC2 instance where you will install apache, MySQL, phpMyAdmin and WordPress.

First of all, you have to login to your account on Amazon Web Services in http://aws.amazon.com/

Amazon aws account login

Choose on the right "Amazon EC2" and click on "Go" to login to your account.

Step 1: Create an Amazon EC2 instance.

Go to the “Amazon EC2″ tab and follow the instructions displayed below:

Launch Amazon EC2 instance

Click on "Launch Instance" to create a new EC2 instance.

Amazon EC2 AMI

Select the indicated AMI from the list.

Amazon EC2 free tier drop down

Select the instance type "micro" (free tier).

EC2 instance options

Leave the default parameters and click on "Continue".

Amazon EC2 Instance key values

On the left column write "Name". On the right side write the name you want for your instance. For example "Blog Server".

Amazon EC2 instance key pair

Write a name for your key pair. After click on "create and download...". You need the downloaded file to connect via SSH.

Amazon EC2 instance security group

Choose a name and description for your security group. After you could choose the allowed connections to your server. Set up the configuration as showed above.

Amazon instance overview

You will see an overview of your intance before being launched. Just click on "launch" to get it ready.

Amazon

Your instance is now launched. Click on "Close" to get back to the menu.

Amazon EC2 new instance

After launching the instance, it will appear in the menu "Instances" of your account.

Step 2: Connect to your EC2 instance via SSH.

Your new EC2 instance has been created in the previous step and now you can remotely connect it via SSH using the generated key pair. To get the connection parameters make a right-click wherever on the row of your instance, a menu will appear as showed:

EC2 Instance connect menu

Click on "Connect".

EC2 Instance connect instructions

A new window will show you how to connect to your instance.

If you’re a Linux or Mac user, to use a terminal would be recommended. If you are a Windows user or you prefer to use Putty, then you will have to adapt your key pair. For example, if you have “yourkey.pem” you will have to create “yourkey.ppk”. You can find helpful information about in the AWS documentation, here is the link http://docs.amazonwebservices.com/AmazonEC2/gsg/2007-01-19/putty.html

You will use the indicated “public DNS” as the URL to access your instance through a web browser but before a http server has to be installed.

Step 3: Install Apache HTTP server and MySQL in the cloud.

Let’s install the software. The first one will be an Apache HTTP server. Once you are successfully connected to your instance execute the following commands:

sudo bash

Note: The previous line will let you execute the following commands as “superuser”. If you forget “sudo bash” at the beginning of your session you won’t have the right permissions and you will have to include each time “sudo ” + <command> to make it work properly. More information about sudo in this link: http://en.wikipedia.org/wiki/Sudo

yum –y update
yum install httpd mysql mysql-server php php-mysql
yum install libmcrypt libmcrypt-devel php-mcrypt php-mbstring
/sbin/chkconfig httpd on
/sbin/chkconfig mysqld on
service httpd start
service mysqld start

At this point apache and MySQL are running on your instance. Now we have to set up MySQL executing the following command and choosing a password for the user “root”

mysqladmin -u root password 'new-password'

Step 4: Install phpMyAdmin in the cloud.

Go to the apache document root folder by default:

cd /var/www/html

Download phpMyAdmin using “wget <phpMyAdmin_tar.gz_URL>”. The latest version available at the moment was taken using the following command:

wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.5/phpMyAdmin-3.4.5-all-languages.tar.gz?r=http%3A%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Fdownloads.php&ts=1317582141&use_mirror=heanet

Uncompress the previous file:

tar -xzvf phpMyAdmin-3.4.5-all-languages.tar.gz
mv phpMyAdmin-3.4.5-all-languages phpmyadmin
adduser phpmyadmin
passwd phpmyadmin
chown -R phpmyadmin.apache phpmyadmin/
cd /var/www/html/phpmyadmin/
mkdir config
chmod o+rw config
cp config.sample.inc.php config/config.inc.php
chmod o+w config/config.inc.php
service httpd restart

Now you can access to phpMyadmin in your web browser using the public DNS associated to your instance. The public DNS is available in the instance properties in the AWS instance menu, or in the “connect” window showed before. So you could connect to phpMyAdmin introducing a similar URL (using the public DNS of your EC2 instance) in your browser:

http://ec2-XX-XX-141-90.eu-west-1.compute.amazonaws.com/phpmyadmin/index.php

Once connected you will see a login screen as showed below where you will introduce “root” as user and the password you chose before when setting up MySQL.

phpMyadmin login screen

Introduce the MySQL user ("root") and password to connect to MySQL through phpMyAdmin

After you login the first time, you will see a warning message about the config folder. The last steps to finalize the installation and setting up are:

cd /var/www/html/phpmyadmin/
rm -rf config
mv config.sample.inc.php config.inc.php

Now you have to edit the config file:

vi config.inc.php

and introduce a value for the key “blowfish_secret”. For example as follows:

$cfg['blowfish_secret'] = 'yourValue'; /* Introduce a value */

Step 5: Setting up the WordPress database in the cloud.

We have succeeded to run MySQL and to access phpMyAdmin via WEB to manage our databases, so let’s create the WordPress database:

wordpress database creation screen

Create a new database named "wordpress".

mysql check privileges wordpress screen

Click on "Check Privileges" to access to the user privileges.

mysql wordpress new user screen

Click on "Add a new user" to create a user for the WordPress database.

new user for wordpress screen.

Create a new user as showed above.

Step 6: Install WordPress in the cloud.

Our EC2 instance is ready to install the web-software provided by WordPress.org. With this application you could manage your own blog as you wish. Let’s install it…

Go to the apache document root folder by default:

cd /var/www/HTML/

Download the latest version of WordPress:

wget http://wordpress.org/latest.tar.gz

Uncompress the previous file and give the following permissions:

tar -xzvf latest.tar.gz
chown -R apache /var/www/html
chmod -R 755 /var/www/html

Now you can access the application using the public DNS of your EC2 instance introducing a similar URL in your web browser:

http://ec2-xx-xx-141-90.eu-west-1.compute.amazonaws.com/wordpress/

You will get the screen showed below, just follow the instructions indicated:

first time connection to wordpress screen

Click on "Create a configuration file".

Click on "Let's go".

mysql credential for wordpress screen

Introduce the user name and password of the WordPress user created before with phpMyAdmin. Leave the rest as showed above.

wordpress configuration form screen

Complete the WordPress form of your blog as you wish!

and it’s done!! you can access your blog introducing a similar URL (using the public DNS of your EC2 instance) in the web browser:

http://ec2-xx-xx-141-90.eu-west-1.compute.amazonaws.com/wordpress/

To login to your WordPress account as administrator introduce a similar URL (using the public DNS of your EC2 instance):

http://ec2-xx-xx-141-90.eu-west-1.compute.amazonaws.com/wordpress/wp-admin/

Now you can login and manage your own blog using WordPress.

Congratulations! at this point you have your blog installed on a cloud computing platform.

Don’t hesitate to leave a comment if you have any question or feedback.

Thanks for visiting semoru.com

 

Solution 2: Create an Amazon EC2 instance using a pre-configured BitNami AMI.

First of all, you have to login to your account on Amazon Web Services in http://aws.amazon.com/

Amazon aws account login

Choose on the right "Amazon EC2" and click on "Go" to login to your account.

Go to the “Amazon EC2″ tab and follow the instructions displayed below:

Launch Amazon EC2 instance

Click on "Launch Instance" to create a new EC2 instance.

Amazon bitnami-wordpress AMI selection

Select one of the instance from the list, where "free-tier" is available (star on the right column is present)

amazon bitnami instance details

Click on "Continue"

Amazon bitnami instance advanced options

Leave the parameters by default and click on "Continue".

Amazon bitnami instance key values

On the left column write "Name". On the right side write the name you want for your instance. For example "Blog Server".

Amazon bitnami key pair

Write a name for your key pair. After click on "create and download...". You might need the downloaded file to connect via ssh.

Amazon bitnami security groups

Choose a name and description for your security group. After you could choose the allowed connections to your server. Set up the configuration as showed above.

Amazon bitnami instance overview

You will see an overview of your intance before being launched. Just click on "launch" to get it ready.

Amazon

Your instance is now launched. Click on "Close" to get back to the menu.

Amazon EC2 new instance

After launching the instance, it will appear in the menu "Instances" of your account.

Once you have launched it, you can select your instance as showed above and check its parameters at the bottom of the page. Check the value of “public DNS” to access to your instance using your web browser. So then, just copy & paste the value of your public DNS and introduce it in your web browser, it will be similar to:

http://ec2-xx-xx-141-90.eu-west-1.compute.amazonaws.com/

If you see the image showed below…Congratulations! the instance has been correctly created. So let’s set it up, just follow the next instructions:

Amazon bitnami welcome page

Click on "Access my application" to access WordPress.

bitnami wordpress welcome page

WordPress welcome page using a bitnami instance. Click on "Log in".

Amazon bitnami wordpress login

Introduce "user" as Username and "bitnami" as Password. Then click on "Log In"

bitnami wordpress dashboard screen

Click on "Yes, take me to my profile" to change the auto generated password.

Congratulations! at this point you have your blog installed on a cloud computing platform.

Don’t hesitate to leave a comment if you have any question or feedback.

Thanks for visiting semoru.com

Share on TwitterSubmit to reddit

10 thoughts on “How to install WordPress in the cloud

  1. Great writeup! You may also want to check out BitNami Cloud Hosting (www.bitnami.org/cloud), which makes the process even easier. We offer a free tier of service to match Amazon’s, so you can get free hosting for one micro server for one year. In addition to providing one click deployment of BitNami apps on the Amazon Cloud, BitNami Cloud Hosting also provides automatic backup scheduling, one click resizing, monitoring and server scheduling (to automatically turn the servers on and off).

    -Erica
    (Disclaimer: I work for BitNami)

    • #1 and #3 are slimpy security via obscurity, which is no security at all. #1 can easily be worked around if you remove or change the default username. A much better idea is to only use the admin account for actual administrating, and use a different account for everything else. Grant it the permission to do everything but change settings (Editor, I think).#2 is somewhat valid however, because if for some reason PHP was temporarily disabled, wp-config.php could be read if in your web-accessible directory. Otherwise, it’s also security through obscurity.

      • aleksandr:А у меня вот такая хрень: пытаюсь с сайта войти в консоль админки а оттуда вот такой фигвам Fatal error: Call to undefined futicnon is_site_admin() in /home/zav/public_html/wp-content/plugins/related-posts.php on line 81 – подскажите начинающему,что делать ,а лучше пропишите путь исправления желательно на русском языке.Заранее благодарен.

  2. Thank you very much for this tutorial, I would not have been able to install it otherwise! I really appreciate the step-by-step approach. Keep up the good work!

  3. Pingback: My Homepage

  4. This was a great tutorial to follow, even today, where many things like this are out of date. I do have one question:

    is there a way to install wordpress at the root, rather than in the directory /wordpress/ ?

    I am going to poke around your site to see if you have written anything on migrating sites and moving domain names. I am looking to move an existing website from dreamhost to Amazon’s Cloud.

    Thank you, again,

    Jay

Leave a Reply

Your email address will not be published. Required fields are marked *

*


five × = 5

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>