Ads Top

Setup LAMP stack on Linux virtual machine

In last discussion we learn how we can make and connect a linux virtual machine on azure. Now we are going to learn inorder to run VM how we can perform LAMP operations.
What is LAMP stack? It is a group of open source software (Linux, Apache, MySql, Php). All these are installed together in order to host a dynamic website on server.
 In this guide we will learn to install to LAMP stack on Ubuntu 14.04


Step 1:

First we need to get updates

sudo apt-get update                                                                                                                        
Now install apache, for this use following command
sudo apt-get install apache2                                                                                                                 

apt
is a Ubuntu package manager, it allows us to install software from a repository that is maintained by Ubuntu

sudo command get executed with root privileges.

Now enter you sever IP address in you browser address bar and you will get a page with message It Works.
 If the page do not open all you need is to add an endpoint in  azure virtual machine.
In order to configure apache you need these commands.
sudo nano /etc/apache2/apache2.conf                                                                                                         



Step 2:

Now it's time to install MySql a database management system use this command to install it.

sudo apt-get install mysql-server                                                                                                              

Step 3:

Now its time to install the P part, PHP, it is used to for th dynamic content for this run this.


sudo apt-get install php5                                                                                                                          
It will install php without any problem in next step we will test it. 


Step 4: 

PHP has been install now its time to check it. Write following code first
  
sudo nano /var/www/html/info.php                                                                                                            
This will open a window and you have to write the following code.

?>                                                                                                                                                               
 phpinfo();                                                                                                                                                  
?>                                                                                                                                                                  
You are finished, in order to the test the code the address you want to write will be.
http//:your_server_ip/info.php                                                                                                                  

This will open a page like this, if it happens it means you are done.

1 comment:

  1. or we can use the easy way:

    sudo apt-get install lamp-server^

    ReplyDelete

Powered by Blogger.