Sunday, August 2, 2026

In AWS EC2 Install and Setup apache, php and mysql in ubuntu OS of AWS EC2

Step 1. First you needs to start your Ubuntu EC2 instance then write command sudo apt-get update 

then type sudo apt-get install apache2.



Step 2. Ones you install apache2 restart it through sudo systemctl restart apache2.


Step 3. For databases, we needs to install mysql server in your EC2 instance by typing sudo apt-get install mysql-server then mysql_secure_installation.



Step 4. During the installsation it will ask your password, you can provide any password or leave it blank.


Step 5. If you wants to run PHP program on your instance then write command sudo apt-get install php. When its complete then type sudo nano /etc/apache2/mods-enabled/dir.conf. Here inside dir-config you needs to move index.php to the first position.


Step 6. Ones we install php and mysql then restart the server with sudo systemctl restart apache2.


Step 7. In order to check the status of apache2 you needs to write sudo systemctl status apache2

No comments:

Post a Comment

Linux vs Windows System Administration Roadmap | Common Skills Guide

 Common Roadmap for Linux & Windows System Administrators Linux System Administration and Windows SystemAdministration have many commo...