{"id":87,"date":"2018-12-15T10:53:55","date_gmt":"2018-12-15T10:53:55","guid":{"rendered":"https:\/\/www.peppypage.com\/blog\/?p=87"},"modified":"2018-12-30T07:20:29","modified_gmt":"2018-12-30T07:20:29","slug":"install-lamp-stack-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/","title":{"rendered":"How to install LAMP (Linux, Apache, MySql and PHP) Stack on Ubuntu"},"content":{"rendered":"\n<p>The following tutorial explains the ways to install LAMP Stack on Ubuntu 17.10, Ubuntu 17.04, Ubuntu 18.04, Ubuntu 18.10<\/p>\n\n\n\n<h2>Install Apache on Ubuntu<\/h2>\n\n\n\n<p>Before we run any command line code make sure you have root aceess.<\/p>\n\n\n\n<p>Open&nbsp;Terminal, and to install lamp stack on Ubuntu we need to start installing apache in first step.<br>First we need to update the package manager and make sure the system is upto date.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<p>to install <strong>Apache <\/strong>type and enter the following code in terminal, type y\/Y\/yes if prompted<\/p>\n\n\n\n<p>Install Apache Using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install apache2<\/code><\/pre>\n\n\n\n<h2>Install Mysql on Ubuntu<\/h2>\n\n\n\n<p>To install mysql on ubuntu type and hit enter the following command in terminal<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install mysql-server<\/code><\/pre>\n\n\n\n<h2>Install PHP and Required dependencies<\/h2>\n\n\n\n<p>The final step of this tutorial is installing PHP and required dependencies using the following commands<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install php php-mysql libapache2-mod-php php-curl<\/code><\/pre>\n\n\n\n<p>Now its time to configure mysql using the following command so that mysql works as expected<\/p>\n\n\n\n<p>From terminal run the following code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>When executed the above code, it asks you several questions, take care of following option:<\/p>\n\n\n\n<ul><li>Validate Password Plugin sets restrictions whenever you create a new db user, so choose option carefully, suggested option &#8211; N\/ignore<\/li><li><\/li><\/ul>\n\n\n\n<p>[OPTIONAL] Once finished, we need to install PhpMyAdmin for managing databases visually.<\/p>\n\n\n\n<p>to install PhpMyAdmin type the following code in terminal and hit enter<\/p>\n\n\n\n<h2>Install PhpMyAdmin in Ubuntu<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install phpmyadmin<\/code><\/pre>\n\n\n\n<p>during installation it will ask you to choose <strong>server option<\/strong>, choose <strong>apache2<\/strong>&nbsp;and to add test database of phpmyadmin, when asked enter root password.&nbsp;<\/p>\n\n\n\n<p>Once PhpMyAdmin installed, we need to add the following line to apache2.conf file so that we will be able to access, using terminal edit the conf file and add the line as given below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/apache2\/apache2.conf\n\n#above code will open the file, then add the following line at the bottom of file (Press i to change to write mode)\n\nInclude \/etc\/phpmyadmin\/apache.conf\n\n#once added press esc and then type :wq!<\/code><\/pre>\n\n\n\n<p>Restart apache using the following code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service apache2 restart<\/code><\/pre>\n\n\n\n<p>That&#8217;s all, you now have LAMP stack installed and working on your Ubuntu. The root directory resides in \/var\/www\/html by default. Open your browser enter locatlhost it will display Apache index file.<\/p>\n\n\n\n<p>Drop a comment if you need any information or help regarding the LAMP installation on Ubuntu.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following tutorial explains the ways to install LAMP Stack on Ubuntu 17.10, Ubuntu 17.04, Ubuntu 18.04, Ubuntu 18.10<\/p>\n","protected":false},"author":1,"featured_media":15,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,6],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to install LAMP (Linux, Apache, MySql and PHP) Stack on Ubuntu - Domain, Web Hosting and Cloud Hosting Trends<\/title>\n<meta name=\"description\" content=\"Learn how to Install LAMP stack on Ubuntu 18.10 and 18.04. Easy and quick tutorial which expains Apache, MySql, PHP and PhpMyAmin setup.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install LAMP (Linux, Apache, MySql and PHP) Stack on Ubuntu - Domain, Web Hosting and Cloud Hosting Trends\" \/>\n<meta property=\"og:description\" content=\"Learn how to Install LAMP stack on Ubuntu 18.10 and 18.04. Easy and quick tutorial which expains Apache, MySql, PHP and PhpMyAmin setup.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Domain, Web Hosting and Cloud Hosting Trends\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-15T10:53:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-12-30T07:20:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.peppypage.com\/content\/wp-content\/uploads\/2018\/07\/blur-close-up-collage-196655.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"4000\" \/>\n\t<meta property=\"og:image:height\" content=\"2667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"bharathsde\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"bharathsde\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.peppypage.com\/content\/#website\",\"url\":\"https:\/\/www.peppypage.com\/content\/\",\"name\":\"Domain, Web Hosting and Cloud Hosting Trends\",\"description\":\"Learn how to secure your app and website\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.peppypage.com\/content\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/\",\"url\":\"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/\",\"name\":\"How to install LAMP (Linux, Apache, MySql and PHP) Stack on Ubuntu - Domain, Web Hosting and Cloud Hosting Trends\",\"isPartOf\":{\"@id\":\"https:\/\/www.peppypage.com\/content\/#website\"},\"datePublished\":\"2018-12-15T10:53:55+00:00\",\"dateModified\":\"2018-12-30T07:20:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.peppypage.com\/content\/#\/schema\/person\/33a613ea798a2b94d8ec79faa0f76403\"},\"description\":\"Learn how to Install LAMP stack on Ubuntu 18.10 and 18.04. Easy and quick tutorial which expains Apache, MySql, PHP and PhpMyAmin setup.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.peppypage.com\/content\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install LAMP (Linux, Apache, MySql and PHP) Stack on Ubuntu\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.peppypage.com\/content\/#\/schema\/person\/33a613ea798a2b94d8ec79faa0f76403\",\"name\":\"bharathsde\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.peppypage.com\/content\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6d56691d057a81ea8a03b12c51675abb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6d56691d057a81ea8a03b12c51675abb?s=96&d=mm&r=g\",\"caption\":\"bharathsde\"},\"url\":\"https:\/\/www.peppypage.com\/content\/author\/bharathsde\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install LAMP (Linux, Apache, MySql and PHP) Stack on Ubuntu - Domain, Web Hosting and Cloud Hosting Trends","description":"Learn how to Install LAMP stack on Ubuntu 18.10 and 18.04. Easy and quick tutorial which expains Apache, MySql, PHP and PhpMyAmin setup.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to install LAMP (Linux, Apache, MySql and PHP) Stack on Ubuntu - Domain, Web Hosting and Cloud Hosting Trends","og_description":"Learn how to Install LAMP stack on Ubuntu 18.10 and 18.04. Easy and quick tutorial which expains Apache, MySql, PHP and PhpMyAmin setup.","og_url":"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/","og_site_name":"Domain, Web Hosting and Cloud Hosting Trends","article_published_time":"2018-12-15T10:53:55+00:00","article_modified_time":"2018-12-30T07:20:29+00:00","og_image":[{"width":4000,"height":2667,"url":"https:\/\/www.peppypage.com\/content\/wp-content\/uploads\/2018\/07\/blur-close-up-collage-196655.jpg","type":"image\/jpeg"}],"author":"bharathsde","twitter_card":"summary_large_image","twitter_misc":{"Written by":"bharathsde","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.peppypage.com\/content\/#website","url":"https:\/\/www.peppypage.com\/content\/","name":"Domain, Web Hosting and Cloud Hosting Trends","description":"Learn how to secure your app and website","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.peppypage.com\/content\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/","url":"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/","name":"How to install LAMP (Linux, Apache, MySql and PHP) Stack on Ubuntu - Domain, Web Hosting and Cloud Hosting Trends","isPartOf":{"@id":"https:\/\/www.peppypage.com\/content\/#website"},"datePublished":"2018-12-15T10:53:55+00:00","dateModified":"2018-12-30T07:20:29+00:00","author":{"@id":"https:\/\/www.peppypage.com\/content\/#\/schema\/person\/33a613ea798a2b94d8ec79faa0f76403"},"description":"Learn how to Install LAMP stack on Ubuntu 18.10 and 18.04. Easy and quick tutorial which expains Apache, MySql, PHP and PhpMyAmin setup.","breadcrumb":{"@id":"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.peppypage.com\/content\/install-lamp-stack-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.peppypage.com\/content\/"},{"@type":"ListItem","position":2,"name":"How to install LAMP (Linux, Apache, MySql and PHP) Stack on Ubuntu"}]},{"@type":"Person","@id":"https:\/\/www.peppypage.com\/content\/#\/schema\/person\/33a613ea798a2b94d8ec79faa0f76403","name":"bharathsde","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.peppypage.com\/content\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6d56691d057a81ea8a03b12c51675abb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6d56691d057a81ea8a03b12c51675abb?s=96&d=mm&r=g","caption":"bharathsde"},"url":"https:\/\/www.peppypage.com\/content\/author\/bharathsde\/"}]}},"_links":{"self":[{"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/posts\/87"}],"collection":[{"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":5,"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":126,"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/posts\/87\/revisions\/126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/media\/15"}],"wp:attachment":[{"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.peppypage.com\/content\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}