Thursday, December 29, 2011

Install Wordpress over Amazon EC2 instance

 LAMP stack has been installed on my Amazon free EC2 instance, now it's time to get something up and running on it so that I test what an Amazon free micro EC2 instance is capable of. I started with a bare bone CentOS instance with and use it as my sandbox for experiencing things. Wordpress would be a good candidate to try. Below are steps I used to install Wordpress 3.3 to my EC2 instance.
  1. login into AWS Management Console and launch the instance (if it's not running).
  2. Connect to the instance with putty.
    • sudo su
  3. Start Apache and MySQL.
    • service httpd start
    • service mysqld start
  4. login into mysql and create a database for Wordpress
    • mysql> CREATE DATABASE wpdb;
      mysql> GRANT ALL PRIVILEGES ON wpdb.* TO wpuser@localhost
          -> IDENTIFIED BY "wpuser-password";
      mysql> FLUSH PRIVILEGES;
      mysql> exit
  5. Download Wordpress and unpack it.
    • cd /var/www/html
      wget http://wordpress.org/latest.zip
      unzip latest.zip
      rm -rf latest.zip
      cp wp-config-sample.php wp-config.php
  6. Change the ownership of all Wordpress file to Apache - chown -R apache:apache wordpress
  7. Open a browser and type in the Wordpress URL. Following the on screen instruction and Wordpress is up and running in no time.
Of course there is an even quicker way to get Wordpress. There are a number of community AMIs that come with Wordpress pre-loaded and you only need to change wp-config.php to get it up and running.

No comments:

Post a Comment