{"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<p>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,&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/httpd.apache.org\/\" target=\"_blank\">Apache http server<\/a>,&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/mariadb.org\/\" target=\"_blank\">MariaDB<\/a>\/<a href=\"https:\/\/www.mysql.com\/\" target=\"_blank\" rel=\"noopener\">MySQL<\/a>&nbsp;relational database management systems and&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.php.net\/\" target=\"_blank\">PHP<\/a>&nbsp;web scripting language.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing LAMP Stack on Ubuntu 20.04<\/h2>\n\n\n\n<p>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<h3 class=\"wp-block-heading\">Run System Update<\/h3>\n\n\n\n<p>To begin with, update and upgrade your system packages;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt upgrade<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Apache Web Server on Ubuntu 20.04<\/h3>\n\n\n\n<p>Apache web server can be installed by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install apache2<\/code><\/pre>\n\n\n\n<p>Once the installation is done, start and enable Apache to run on system boot.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable --now apache2<\/code><\/pre>\n\n\n\n<p>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<pre class=\"wp-block-preformatted\"><code>ufw allow Apache<\/code><\/pre>\n\n\n\n<p>or simply run <strong><code>ufw allow 80\/tcp<\/code><\/strong> to allow HTTP traffic.<\/p>\n\n\n\n<p>Verify external access to Apache by navigating to your browser and entering the server IP address or hostname as&nbsp;<strong><code>http:\/\/Server.IP_or_hostname<\/code><\/strong>. You should land on Apache HTTP server test page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"943\" height=\"685\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/apache-test-page.png\" alt=\"Install Apache on Ubuntu 20.04\" class=\"wp-image-5623\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/apache-test-page.png?v=1588181777 943w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/apache-test-page-768x558.png?v=1588181777 768w\" sizes=\"(max-width: 943px) 100vw, 943px\" \/><\/figure>\n\n\n\n<p>Great. Proceed to install MySQL\/MariaDB on Ubuntu 20.04.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install MySQL Database Server on Ubuntu 20.04<\/h3>\n\n\n\n<p>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<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-mysql-8-on-ubuntu-20-04\/\" target=\"_blank\">Install MySQL 8 on Ubuntu 20.04<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install PHP on Ubuntu 20.04<\/h3>\n\n\n\n<p>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<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-php-7-4-on-ubuntu-20-04\/\" target=\"_blank\">Install PHP 7.4 on Ubuntu 20.04<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Installing PHP Modules on Ubuntu 20.04<\/h4>\n\n\n\n<p>Installation of PHP installs with itself other PHP modules such as, <code>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<p>Install MySQL module for PHP and any other module you may need for your web application.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install php7.4-mysql<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Testing PHP Processing&nbsp;on Ubuntu 20.04<\/h4>\n\n\n\n<p>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<pre class=\"wp-block-preformatted\"><code>echo \"&lt;?php phpinfo(); ?&gt;\" &gt; \/var\/www\/html\/info.php<\/code><\/pre>\n\n\n\n<p>Restart Apache<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart apache2<\/code><\/pre>\n\n\n\n<p>Next, navigate to the browser and enter the address,&nbsp;<strong>http:\/\/&lt;server-IP&gt;\/info.php<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"834\" height=\"686\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/php-test.png\" alt=\"PHP ubuntu 20.04\" class=\"wp-image-5628\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/php-test.png?v=1588185283 834w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/04\/php-test-768x632.png?v=1588185283 768w\" sizes=\"(max-width: 834px) 100vw, 834px\" \/><\/figure>\n\n\n\n<p>If you see this page, then PHP installation is working pretty well.<\/p>\n\n\n\n<p>That marks the end of our guide on how to installing LAMP stack on Ubuntu 20.04.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Related Tutorials<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-lamp-stack-on-centos-8\/\" target=\"_blank\">Install LAMP Stack on CentOS 8<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-lamp-stack-with-mariadb-10-on-debian-10-buster\/\" target=\"_blank\">Install LAMP Stack with MariaDB 10 on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-lamp-stack-on-fedora-30\/\" target=\"_blank\">Install LAMP Stack on Fedora 30<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-lamp-stack-on-debian-9\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install LAMP Stack on Debian 9<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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}]}}