Wednesday, 13 July 2016

thumbnail

How-to-install-and-configure-LAMP-in-Ubuntu-14.04-instance-in-Amazon-EC2

Introduction 

In this tutorial we will install LAMP on Ubuntu-14.04 instance on Amazon EC2. To do that we had create an instance on amazon and generate the ssh key pair.

So I have generated the key pair and i will be loging in with ssh from my terminal

The default username for ubuntu instance is "ubuntu"

1. Open the terminal do the following :-

ssh -i root.pem ubuntu@10.10.10.10

2. First of all update your instance :-

sudo apt-get update -y

3. Now install Apache2 web service :-

sudo apt-get install apache2




Default document root is inside /var/www/html
Default configuration file /etc/apache2/sites-available/

4. Now install and configure Mysql server :-

sudo apt-get install mysql-server -y




Finish the installation by running the following script

sudo /usr/bin/mysql_secure_installation



5. Install and configure PHP :-

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php-pear


You can also install other php module by searching

sudo apt-cache php5-

sudo apt-get install php5-modulename 

6. Now let install phpmyadmin :-

sudo apt-get install phpmyadmin -y






Before testing it from the browser check the port is opened or not in your amazon console. If it is not open then open up the port your require.

Select the instance you want to open the port :-


Check in Description section  you will find Security groups. Click on launch-wizard-2


Security Group downside click on "Edit" button to open ports :-



 Now lets check in the browser :-

http://10.10.10.10/phpmyadmin 



You can also check php by putting info file inside /var/www/html/info.php

sudo vim /var/www/html/info.php

<?php

phpinfo();

?>

Try putting php info code there and check mine is working fine.


That's it 
Enjoy using it !!!!!

Related Posts :

Subscribe by Email

Follow Updates Articles from This Blog via Email

No Comments