Preloader
img

LAMP: Linux Apache MySQL PHP Server

Step By Step To Install LAMP - Linux Apache MySQL & PHP Installation

We can use LAMP server to host our static and dynamic website. This is very straight forward way to setup and deploy any kind of application on Linux based EC2 instance.

Tech Stack Requirement: 

OS: Ubuntu 

Instance Type: t3.medium

SSH Access With Root 

Load Balancer

Route53

AWS ACM - SSL Certificate

Installation Steps :

1. Login to EC2 and update the packages.

# apt update && apt upgrade -y

2. Install Apache Web Server

# apt-get install apache2

3. Check apache2 service status if stopped status then start it.

# systemctl status apache2

4. Make sure service should start when server stop/start or rebooted.

# systemctl enable apache2 

 

Installation Of MySQL:

1. Install MySQL Server   

# apt-get install mysql-server

2. Check MySQL Service Status                         

# systemctl status mysql

3. To Stop/Start/Restart MySQL Service                                 

# systemctl restart mysql

4. Setup MySQL root password and remove unnecessary database and other settings                 

# mysql_secure_installation

5. Login to MySQL Prompt With Root User. Default password is blank.              

# mysql -u root -p

Installation Of PHP

1. Install Latest Stable Version Of PHP                           

# sudo apt install php libapache2-mod-php php-mysql                   

2. Check PHP Version Details                             

# php -v                            

3. Enable index.php in apache2 config file.       

# vim /etc/apache2/mods-enabled/dir.conf                             

DirectoryIndex index.php

4. Restart Apache2 Service                             

# systemctl restart apache2                           

 

Happy Learning...!!

Uxito Technologies