{"id":5622,"date":"2020-04-29T21:45:38","date_gmt":"2020-04-29T18:45:38","guid":{"rendered":"https:\/\/kifarunix.com\/?p=5622"},"modified":"2024-03-14T20:03:39","modified_gmt":"2024-03-14T17:03:39","slug":"install-lamp-stack-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-lamp-stack-on-ubuntu-20-04\/","title":{"rendered":"Install LAMP Stack on Ubuntu 20.04"},"content":{"rendered":"\n

Welcome to our guide on how to install LAMP Stack on Ubuntu 20.04. If you are looking at building some web application, LAMP stack is the first thing you might need. As you already know, LAMP is a group of opensource web development softwares; Linux OS, Apache http server<\/a>, MariaDB<\/a>\/MySQL<\/a> relational database management systems and PHP<\/a> web scripting language.<\/p>\n\n\n\n

Installing LAMP Stack on Ubuntu 20.04<\/h2>\n\n\n\n

As per the acronym, Linux system is the first component of LAMP stack. And since you are here, Ubuntu 20.04 is our first component of LAMP stack.<\/p>\n\n\n\n

Run System Update<\/h3>\n\n\n\n

To begin with, update and upgrade your system packages;<\/p>\n\n\n\n

apt update<\/code><\/pre>\n\n\n\n
apt upgrade<\/code><\/pre>\n\n\n\n

Install Apache Web Server on Ubuntu 20.04<\/h3>\n\n\n\n

Apache web server can be installed by running the command below;<\/p>\n\n\n\n

apt install apache2<\/code><\/pre>\n\n\n\n

Once the installation is done, start and enable Apache to run on system boot.<\/p>\n\n\n\n

systemctl enable --now apache2<\/code><\/pre>\n\n\n\n

If you going to be accessing Apache from your external system, then you need to allow it on firewall, that is, in case UFW is running;<\/p>\n\n\n\n

ufw allow Apache<\/code><\/pre>\n\n\n\n

or simply run ufw allow 80\/tcp<\/code><\/strong> to allow HTTP traffic.<\/p>\n\n\n\n

Verify external access to Apache by navigating to your browser and entering the server IP address or hostname as http:\/\/Server.IP_or_hostname<\/code><\/strong>. You should land on Apache HTTP server test page.<\/p>\n\n\n\n

\"Install<\/figure>\n\n\n\n

Great. Proceed to install MySQL\/MariaDB on Ubuntu 20.04.<\/p>\n\n\n\n

Install MySQL Database Server on Ubuntu 20.04<\/h3>\n\n\n\n

In this demo, we are running LAMP stack on Ubuntu 20.04 with MySQL 8. Therefore, follow the link below to install MySQL 8 on Ubuntu 20.04;<\/p>\n\n\n\n

Install MySQL 8 on Ubuntu 20.04<\/a><\/p>\n\n\n\n

Install PHP on Ubuntu 20.04<\/h3>\n\n\n\n

PHP is the last but not least component in LAMP Stack. In this demo, we are going to use PHP 7.4 for our LAMP stack. Follow the link below to learn how to install PHP 7.4 on Ubuntu 20.04;<\/p>\n\n\n\n

Install PHP 7.4 on Ubuntu 20.04<\/a><\/p>\n\n\n\n

Installing PHP Modules on Ubuntu 20.04<\/h4>\n\n\n\n

Installation of PHP installs with itself other PHP modules such as, libapache2-mod-php7.4, php-common, php7.4-cli, php7.4-common, php7.4-json, php7.4-opcache, php7.4-readline<\/code><\/p>\n\n\n\n

Install MySQL module for PHP and any other module you may need for your web application.<\/p>\n\n\n\n

apt install php7.4-mysql<\/code><\/pre>\n\n\n\n

Testing PHP Processing on Ubuntu 20.04<\/h4>\n\n\n\n

You can test PHP to confirm that is working as required as well check the version and installed modules using the simple PHP info script.<\/p>\n\n\n\n

echo \"<?php phpinfo(); ?>\" > \/var\/www\/html\/info.php<\/code><\/pre>\n\n\n\n

Restart Apache<\/p>\n\n\n\n

systemctl restart apache2<\/code><\/pre>\n\n\n\n

Next, navigate to the browser and enter the address, http:\/\/<server-IP>\/info.php<\/strong><\/p>\n\n\n\n

\"PHP<\/figure>\n\n\n\n

If you see this page, then PHP installation is working pretty well.<\/p>\n\n\n\n

That marks the end of our guide on how to installing LAMP stack on Ubuntu 20.04.<\/p>\n\n\n\n

Related Tutorials<\/h3>\n\n\n\n

Install LAMP Stack on CentOS 8<\/a><\/p>\n\n\n\n

Install LAMP Stack with MariaDB 10 on Debian 10 Buster<\/a><\/p>\n\n\n\n

Install LAMP Stack on Fedora 30<\/a><\/p>\n\n\n\n

Install LAMP Stack on Debian 9<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Welcome to our guide on how to install LAMP Stack on Ubuntu 20.04. If you are looking at building some web application, LAMP stack is<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,299,201,342],"tags":[1515,204,1517,999,1132,1200],"class_list":["post-5622","post","type-post","status-publish","format-standard","hentry","category-howtos","category-database","category-lamp-stack","category-php","tag-install-lamp-stack-ubuntu-20-04","tag-lamp-stack","tag-lamp-stack-ubuntu-20-04","tag-mysql-8","tag-php-7-4","tag-ubuntu-20-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5622"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=5622"}],"version-history":[{"count":5,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5622\/revisions"}],"predecessor-version":[{"id":21349,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5622\/revisions\/21349"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=5622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=5622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=5622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}