1. Update the package index and upgrade the existing packages on the server:
    sudo apt update
    sudo apt upgrade
  2. Install Apache web server:
    sudo apt install apache2
  3. Allow Apache through the firewall:
    sudo ufw allow in "Apache"
  4. Check if Apache is running by visiting your server’s IP address in a web browser:
    http://your_server_ip_address
  5. Install MySQL:
    sudo apt install mysql-server
  6. Run a secure installation of MySQL and set the root password:
    sudo mysql_secure_installation
  7. Install PHP:
    sudo apt install php libapache2-mod-php php-mysql
  8. Create a test PHP file:
    sudo nano /var/www/html/info.php
    Add the following code and save the file:
    <?php
    phpinfo();
    ?>
  9. Restart Apache:
    sudo systemctl restart apache2
  10. Visit the test PHP file in a web browser by entering the following URL:
    http://your_server_ip_address/info.php
  11. Delete the test PHP file after verifying the installation:
    sudo rm /var/www/html/info.php

Leave a Reply