{"id":2019,"date":"2024-02-15T11:55:31","date_gmt":"2024-02-15T11:55:31","guid":{"rendered":"https:\/\/gnutechnocrats.com\/blog\/?p=2019"},"modified":"2024-02-15T12:19:23","modified_gmt":"2024-02-15T12:19:23","slug":"setting-up-a-lamp-stack-on-ubuntu-a-step-by-step-guide-in-ubuntu","status":"publish","type":"post","link":"https:\/\/gnutechnocrats.com\/blog\/setting-up-a-lamp-stack-on-ubuntu-a-step-by-step-guide-in-ubuntu\/","title":{"rendered":"LAMP Stack on Ubuntu: The Easiest Step-by-Step Guide"},"content":{"rendered":"<p>Welcome to the easiest step-by-step guide for setting up a LAMP (Linux, Apache, MySQL, PHP) stack on your Ubuntu server. Whether you&#8217;re a beginner or just looking for a quick refresher, this guide will walk you through the process seamlessly.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Step 1 \u2013 Installing Apache<\/strong><\/p>\n<p>Update the package list for upgrades and new packages:<\/p>\n<p><strong>sudo apt-get update<\/strong><\/p>\n<p>Now Apache can be installed.<\/p>\n<p><code><strong>sudo apt-get install apache2<\/strong><\/code><\/p>\n<p><strong>Step 2 \u2013 Installing MySql<\/strong><\/p>\n<p>Install MySql Server<\/p>\n<p><code><strong>sudo apt-get install mysql-server<\/strong><\/code><\/p>\n<p>After MySql has been installed, you will need to set the root password of the database and secure it using the following command :<\/p>\n<p><strong>sudo mysql_secure_installation<\/strong><\/p>\n<p>You will be presented a screen where MySQL asks whether you would like to activate the VALIDATE PASSWORD PLUGIN. For now, keeping things simple, type\u00a0<strong>no<\/strong>.<\/p>\n<p>In the next type the root password of your choice. Confirm it again.<\/p>\n<p>In the next screen MySql will ask whether to remove anonymous users. Type\u00a0<strong>yes<\/strong>\u00a0Disallow root login remotely?<\/p>\n<p>Type\u00a0<strong>No<\/strong>\u00a0Remove test database and access to it?<\/p>\n<p>Type\u00a0<strong>Yes<\/strong>\u00a0Reload privilege tables now?<\/p>\n<p>Type\u00a0<strong>Yes<\/strong><\/p>\n<p>After the password has been set you can check the whether MySQL is working correctly by logging into the database with the command :<\/p>\n<p><strong>sudo mysql -u root -p<\/strong><\/p>\n<p>Password is the same that was set in the previous step.<\/p>\n<p><strong>Step 3 \u2013 Installing PHP with Common Extensions<\/strong><\/p>\n<p>Now install PHP and commonly used PHP extensions by using the following command :<\/p>\n<p><code><strong>sudo apt-get install php libapache2-mod-php php-mysql php-curl php-gd php-json php-zip php-mbstring<\/strong><\/code><\/p>\n<p>After PHP has been installed, restart Apache.<\/p>\n<p><code><strong>sudo service apache2 restart<\/strong><\/code><\/p>\n<p>&nbsp;<\/p>\n<h2>Conclusion:<\/h2>\n<p>Congratulations! You&#8217;ve successfully set up a LAMP stack on your Ubuntu server. This powerful combination of Linux, Apache, MySQL, and PHP provides a robust platform for hosting dynamic websites and applications. Feel free to explore further customization based on your specific needs. If you encounter any issues, refer to the official documentation or seek assistance from the community forums. Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to the easiest step-by-step guide for setting up a LAMP (Linux, Apache, MySQL, PHP) stack on your Ubuntu server. Whether you&#8217;re a beginner or just looking for a quick refresher, this guide will walk you through the process seamlessly. &nbsp; Step 1 \u2013 Installing Apache Update the package list for upgrades and new packages: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2023,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,49],"tags":[],"class_list":["post-2019","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/posts\/2019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/comments?post=2019"}],"version-history":[{"count":3,"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/posts\/2019\/revisions"}],"predecessor-version":[{"id":2021,"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/posts\/2019\/revisions\/2021"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/media\/2023"}],"wp:attachment":[{"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/media?parent=2019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/categories?post=2019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gnutechnocrats.com\/blog\/wp-json\/wp\/v2\/tags?post=2019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}