Looking to host a webpage or a website? This tutorial will guide you to install LAMP on your Ubuntu Shell.
LAMP stack - is an open-source web development platform that uses:
• Linux - Operating System
• Apache - HTTP Server
• MySQL - RDBMS/Database
• PHP - Object-oriented scripting language
The installation has to be done by a user with sudo access or root privileges.
Let's first add the PHP 8 PPA repository and re-synchronize the package index
files from their source:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Install Apache:
sudo apt-get install apache2 -y
Install MySQL:
sudo apt-get install mysql-server php8.0-mysql -y
Install PHP:
sudo apt-get install php8.0 -y
Installation is completed, we just need to restart our Apache web server:
sudo service apache2 restart
To verify LAMP installation, open the following page with any available web browser:
http://*Shell_dedicated_IP*/index.html
or
http://localhost
You should see a similar output:
To verify PHP installation, you may create a PHP INFO test page inside /var/www/html
directory with the following command:
$ echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/phpinfo.php
PHP is working properly if you see the below page:
We hope this article helped you set up LAMP on your Ubuntu Shell!
Comments
0 comments
Please sign in to leave a comment.