How to install LAMP on Debian 10 (Buster)

 

To install LAMP (Linux, Apache, MySQL, PHP) on Debian 10 (Buster), you can use the following steps:

  1. Install Apache web server:
sudo apt-get update
sudo apt-get install apache2 -y
  1. Install MySQL server:
sudo apt-get install mysql-server -y
  1. Install PHP and necessary modules:
sudo apt-get install php php-mysql libapache2-mod-php -y
  1. After installation, start Apache and MySQL services:
sudo systemctl start apache2
sudo systemctl start mysql
  1. To start the Apache and MySQL services on boot:
sudo systemctl enable apache2
sudo systemctl enable mysql
  1. To test your LAMP installation, create a new file in /var/www/html/ directory with the name info.php and add the following line in it:
<?php phpinfo(); ?>
  1. Access the file in a web browser by visiting http://your-ip-address/info.php. You should see the PHP information page, indicating that LAMP is correctly installed.

Note: You should secure your mysql installation with mysql_secure_installation command, set a root password and remove test user and test databases.

(Alprazolam)

Leave a Comment