What is LAMP?

LAMP (Linux, Apache, MySQL, PHP/Perl/Python) is an acronym that refers to one of the most widely used software stacks for many of the web’s most popular applications.

Step 1 – Update/Upgrade your package index

sudo apt update
sudo apt upgrade
Update your package index

Step 2 – Install Apache

apt-get install -y apache2
Install Apache Ubuntu

Now open your favorite browser and navigate to your server IP to check if the Apache has been installed successfully

Apache ubuntu

Step 3 – Install MySQL

apt-get install -y mysql-server
Install MySQL Ubuntu

Let’s secure our MySQL server

Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Please set the password for root here.
New password:
Re-enter new password:
Estimated strength of the password: 25
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
 - Removing privileges on test database...
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
All done!

Step 4 – Install PHP

apt-get install -y php libapache2-mod-php php-mysql

Check if the PHP has been installed successfully

root@node1:~# php -v
PHP 7.4.3 (cli) (built: Jun 13 2022 13:43:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: