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
Step 2 – Install Apache
apt-get install -y apache2
Now open your favorite browser and navigate to your server IP to check if the Apache has been installed successfully
Step 3 – Install MySQL
apt-get install -y mysql-server
Let’s secure our MySQL server
/usr/bin/mysql_secure_installation
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
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
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
Success.
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
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
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
Success.
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
root@node1:~#
4 Comments
How To Change SSH Port On Linux Or Unix - Virtono Community · April 6, 2023 at 12:30 PM
[…] SSH port Ubuntu, Debian, […]
How To Install Ansible On CentOS - Virtono Community · April 18, 2023 at 2:32 PM
[…] this article, we will discuss how to install Ansible on CentOS, one of the most popular Linux distributions used in server […]
How To Install LEMP Stack (Linux, Nginx, MySQL, And PHP) On Ubuntu 22.04 - Virtono Community · June 20, 2023 at 10:35 AM
[…] website. MySQL is a well-known relational database administration system. Run the following command to install MySQL our second LEMP stack […]
How To Install Nagios On Ubuntu 22.04 - Virtono Community · September 26, 2023 at 1:08 PM
[…] script sets up the necessary software for Nagios to run properly, including Apache, PHP, and a number of […]