Pages

Installation of LAMP stack on Debian/Ubuntu

Popular enterprises applications run on the LAMP stack; Linux, Apache, MySQL/MariaDB, and PHP. WordPress, Drupal, Moodle, and similar application software run on LAMP. Installation of a LAMP stack on Linux-based operating systems like Debian/Ubuntu is comparatively easier than before.

Install the latest stable version of Debian/Ubuntu first. I prefer to use lightweight Ubuntu flavour Xubuntu for this purpose. Here are the steps and commands to install LAMP infrastructure.

Update the Debian/Ubuntu
sudo apt update
sudo apt upgrade


Installing Apache
sudo apt install apache2

Test Apache
Open the browser and enter the URL, 127.0.1.1
See the Apache screen.
Apache home page

Installing MariaDB Database
sudo apt install mariadb-server mariadb-client

Secure MariaDB

sudo mysql_secure_installation

The process asks questions, read them well, and answer. On the way, it asks to give the root password, enter it. The root password is very important and remembers it. 

Access MariaDB shell
Test the newly installed MariaDB. Apply the following command.

sudo mysql -u root

Enter the Root password created for MariaDB. To exit from the shell, type exit.

Installing PHP
Here is the command to install the PHP language.

sudo apt install php libapache2-mod-php php-mysql
sudo systemctl restart apache2

Create an info.php page to check the running status of the PHP. Create the following file and a few PHP lines.

sudo mousepad /var/www/html/info.php

Copy and paste the following code in the file, then save the file and exit it.

Enter the following URL on the web browser; 127.0.1.1/info.php

LAMP infrastructure on Debian/Ubuntu is ready. Now try to install any PHP based software like WordPress, PHPMyAdmin etc.

No comments:

Post a Comment