How To Install Wordpress On Amazon EC2 Ubuntu Instance

By Cloud Techie Thursday, 27 December 2012
Pluralsight
You can have WordPress on amazon by three methods.

1) you can launch an instance using a preconfigured AMI

2) you can install it manually on your server from the scratch.

3) You can use cloudformation default template to launch an instance with wordpress

In this tutorial am going to explain, how to install WordPress on amazon Ubuntu instance from scratch.
Getting Started:
1. Launch an Ubuntu Instance: Follow this tutorial How To launch an Ubuntu Instance on Amzon EC2

2.Connect the instance using putty : Follow this tutorial to do that How To connect Amzon EC2 ubuntu Instance Using Putty

3.Update the Server: Once you connect the connect to the server using putty ,you have to update the server.
sudo apt-get update
You can set up the lamp server using a single command or you can install all the packages seperately. To install lamp server , execute the following command.
sudo apt-get install lamp-server^
The above command will install Php ,Mysql, and Apache. You have to install phpmyadmin separately. For that i have given the code at step 7. If you are going to install LAMP server using the above command, then skip steps 4, 5 and 6.
Manual installation of Lamp Server:
4. Install MySql: Install the MySql package on ubuntu Instance.
sudo apt-get install mysql-server mysql-client libmysqlclient15-dev
5. Install Apache2:
sudo apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
6. Install PHP:
sudo apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-mcrypt php5-mysql php5-ps php5-pspell php5-recode php5-xsl
7. Install PHP Myadmin:
sudo apt-get install phpmyadmin
8. Now enter the public DNS of your server in browser and check if the web page shows a message "it works" as shown in the following figure. If it appears then we are all good with the installation process till now.

checking apache2 server
9. Go to [your public DNS]/phpmyadmin and enter the username as root and the password you used during MYSql installation. 
[eg :http://ec2-64-435-274-34.compute-1.amazonaws.com/phpmyadmin/]

10. In phpmyadmin page Goto-->privileges-->add user ,enter the user name and password of your choice. Host name is localhost and under database select "grant all users" as shown in the following figure.


phpmyadmin

11. Download wordpress file to the server . Make sure you download the WordPress file inside WWW folder and untar it using the following commands.
cd /var/www/
sudo wget http://wordpress.org/latest.tar.gz
sudo tar -zxvf latest.tar.gz 
12. Basically the index.html file will be present inside www folder.Remove it using # sudo rm index.html.

13. Now enter the public DNS followed by /wordpress using browser.There you can see the wordpress file. Click it and then click "create a configuration file". If you want your wordpress directly accessible by the public DNS, then you have to copy the files inside wordpress folder to WWW folder.


wordpress

Note: if you want your wordpress site accessible directly using the url without addint "/wordpress" suffix, then copy all the files from /var/www/wodpress folder to /var/www


14. click "lets go" button.



15. Enter the sql user name and password you created in php mypmyadmin dashboard and click submit.


16. Click "run and install"



17. Login to  WordPress using the username and password that you have created during installation process.

Thats it !! your WordPress installation is done. Now you can  manage your WordPress site using its dashboard.

wordpress


Like and leave a comment if you liked the tutorial.

Related: