<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Feroz Chand</title>
    <description>The latest articles on DEV Community by Feroz Chand (@ferozxqc).</description>
    <link>https://dev.to/ferozxqc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1396757%2Fa419b5ba-e89a-45ae-9a0b-d1e1aa766d23.png</url>
      <title>DEV Community: Feroz Chand</title>
      <link>https://dev.to/ferozxqc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ferozxqc"/>
    <language>en</language>
    <item>
      <title>Setting up LAMP stack on Ubuntu in under 10 minutes</title>
      <dc:creator>Feroz Chand</dc:creator>
      <pubDate>Sat, 30 Mar 2024 04:36:28 +0000</pubDate>
      <link>https://dev.to/ferozxqc/setting-up-lamp-stack-on-ubuntu-in-under-10-minutes-7fc</link>
      <guid>https://dev.to/ferozxqc/setting-up-lamp-stack-on-ubuntu-in-under-10-minutes-7fc</guid>
      <description>&lt;p&gt;Efficiency is crucial in today's digital world. That's why we're here to demonstrate how you can set up the LAMP stack (Linux, Apache, MySQL, PHP) on Ubuntu 20.04 in under 10 minutes. With Ubuntu 20.04's user-friendly interface and dependable performance, it's the ideal platform for this task. Let's dive in and streamline your development process!&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Apache and configuring our Firewall
&lt;/h2&gt;

&lt;p&gt;Apache2 is one of the best open-source webserver currently out there. To set up Apache on Ubuntu 20.04, first, update the package index and install Apache with these commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install apache2 -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, Apache starts automatically. Verify the installation by entering your server's IP address in a web browser; you should see the Apache2 Ubuntu Default Page.&lt;/p&gt;

&lt;p&gt;Next, configure the firewall to allow HTTP (port 80) and HTTPS (port 443) traffic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow 'Apache Full'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the changes take effect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Status: active

To                         Action      From
--                         ------      ----
Apache Full                ALLOW       Anywhere                  
Apache Full (v6)           ALLOW       Anywhere (v6)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now go to the server URL (IP address) and the apache2 default page will be displayed on the screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ydo5c0qqenso68rw3h8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ydo5c0qqenso68rw3h8.png" alt="Apache2 landing page." width="560" height="625"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! You have successfully installed Apache on Ubuntu 20.04. We can now move on to MySQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing MySQL on Ubuntu 20.04
&lt;/h2&gt;

&lt;p&gt;In the LAMP stack, MySQL serves as the backbone for data management. Here's a step-by-step guide to installing MySQL on your Ubuntu 20.04 server.&lt;/p&gt;

&lt;p&gt;To kickstart the installation process, execute the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install mysql-server -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To verify that MySQL is running correctly, execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see an active (running) status, indicating that MySQL is operational.&lt;/p&gt;

&lt;p&gt;With MySQL installed and secured, your LAMP stack is nearly complete. Next, we'll proceed to install PHP, the final component, enabling server-side scripting and dynamic content generation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing PHP on Ubuntu 20.04
&lt;/h2&gt;

&lt;p&gt;Now, let's proceed with installing PHP, the dynamic scripting language that completes the trio in your LAMP stack, enabling powerful server-side functionality.&lt;/p&gt;

&lt;p&gt;To begin, execute the following command to install PHP and essential extensions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install php libapache2-mod-php php-mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command not only installs PHP but also ensures compatibility with MySQL and Apache, seamlessly integrating all components of your LAMP stack.&lt;/p&gt;

&lt;p&gt;Once PHP is installed, you can verify the installation by creating a test PHP file. Use the following command to create a file named info.php in the default web directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /var/www/html/info.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this file, add the following PHP code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
phpinfo();
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and close the file. Now, access this file through your web browser by navigating to "&lt;a href="http://your_server_ip/info.php"&gt;http://your_server_ip/info.php&lt;/a&gt;". You should see a comprehensive PHP information page, confirming that PHP is installed and operational.&lt;/p&gt;

&lt;p&gt;With PHP successfully installed and configured, your LAMP stack is now fully equipped to handle dynamic content and power your web applications. Congratulations on completing the setup!&lt;/p&gt;

</description>
      <category>lamp</category>
      <category>linux</category>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
