Skip to content
Technology News Information & Jobs

Technology News Information & Jobs

Ubuntu Tutorials, Ubuntu How To , Linux Tips, Tech Jobs

  • Work with US
  • Search Jobs
  • Post a Job
  • Contact Us
  • Ubuntu
    • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Themes
  • Linux
  • Laptops
  • Tutorials
  • Job Dashboard
  • Toggle search form
Install Linux, Apache, MySQL, PHP On Ubuntu 20.04 (LAMP)

Install Linux, Apache, MySQL, PHP On Ubuntu 20.04 (LAMP)

Posted on May 3, 2020 By admin No Comments on Install Linux, Apache, MySQL, PHP On Ubuntu 20.04 (LAMP)

Tutorial to install Linux, Apache, MySQL, PHP On Ubuntu 20.04

We will go through the process of installing a LAMP stack on the Ubuntu 20.04 LTS operating system. LAMP stands for Linux, Apache, MySQL, and Php.

Install Linux, Apache, MySQL, PHP On Ubuntu 20.04 (LAMP)

We’ll install a LAMP stack or Linux, Apache, MySQL and Php on your Ubuntu 20.04 LTS.

Step 1:

Install Apache On Ubuntu 20.04 LTS

Steps to install the Apache webserver on Ubuntu 20.04 LTS. Execute the following command in the Ubuntu 20.04 LTS terminal to install Apache.

sudo apt update
sudo apt install apache2

Now adjust your firewall settings to allow HTTP and HTTPS traffic.

Run the following command to list out the available UFW application profiles.

sudo ufw app list

You will see output like this:

Available applications:
Apache
Apache Full
Apache Secure
OpenSSH

Apache: Only port 80 open.
Apache Full: Port 80 and port 443 open.
Apache Secure: Port 443 open.

Run the following command to allow traffic only on port 80.

sudo ufw allow in "Apache"

Open your browser and type your IP address. You will see the Ubuntu 20.04 default Apache web page.

Step 2:

Install MySQL on Ubuntu 20.04 LTS

MySQL is a popular database management system. Run the following command to install MySQL on Ubuntu.

sudo apt install mysql-server

Confirm installation by typing Y, and then ENTER.

When the installation is finished, let’s go through the security configuration.

sudo mysql_secure_installation

You will see a message where it asks if you want to configure the VALIDATE PASSWORD PLUGIN.

Answer Y for yes, or any other key for No.

READ More Relevant Stuff:  Linux Laptop With Ubuntu 20.04 Is Available To Buy At $1,099.99

If you answer “yes”, you’ll see the option of selecting the level of password validation. Follow the onscreen instruction to set a password.

Install Php On Ubuntu 20.04 LTS

sudo apt install php libapache2-mod-php php-mysql

php-mysql: To communicate with MySQL-based databases.

libapache2-mod-php : To enable Apache to handle PHP files.

Run the following command to confirm your PHP version:

php -v

How To Create Virtual Host In Ubuntu 20.04 LTS

Create the directory for your website or domain (localhost) as follows:

sudo mkdir /var/www/your_domain 

Now. Assign ownership of the directory with the $USER environment variable

sudo chown -R $USER:$USER /var/www/your_domain

Now, create a new file in  Apache’s sites-available directory:

sudo nano /etc/apache2/sites-available/your_domain.conf
Now, paste the following information in your new file your_domain.conf.

<VirtualHost *:80>
    ServerName your_domain
    ServerAlias www.your_domain
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/your_domain
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Save and close the file. For nano user, Press CTRL+X, then Y and ENTER.

Enable the new virtual host:

sudo a2ensite your_domain
Ubuntu 20.04 Tags:Apache, LAMP, ubuntu

Post navigation

Previous Post: Install Nginx On Ubuntu 20.04 LTS
Next Post: Remove Files And Directories In Linux From Terminal

Related Posts

Install Numix Circle Icon Theme In Ubuntu 20.04 LTS : Ubuntu Themes Themes
Display And Control Your Android Device From Ubuntu 20.04 Display And Control Your Android Device From Ubuntu 20.04 Ubuntu 20.04
How To Fix “Sub-process /usr/bin/dpkg returned an error code (1)” Error In Ubuntu How To Fix “Sub-process /usr/bin/dpkg returned an error code (1)” Error In Ubuntu Fix
Best GNOME Shell Extensions For Ubuntu 20.04 LTS/ 22.04 LTS Best GNOME Shell Extensions For Ubuntu 20.04 LTS/ 22.04 LTS How To Ubuntu
Install Google Chrome in Ubuntu 20.04 LTS Via Official Repo Install Google Chrome in Ubuntu 20.04 LTS Via Official Repo Ubuntu 20.04
Ubuntu 20.04 LTS Vs Linux Mint 20: Which One To Install? Ubuntu 20.04 LTS Vs Linux Mint 20 : Which One To Install? Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • New Job Search October 10, 2025
  • How To Enable Hibernate in Ubuntu 22.04 LTS May 20, 2024
  • Popular Ubuntu Games: Top 5 Games To Play March 17, 2024
  • WordPress | Your site doesn’t include support for the “generateblocks/container” block GenerateBlocks Plugin February 11, 2024
  • Ubuntu Autoremove Command Debian Autoremove Command February 10, 2024
  • How To Mount Windows 11 Shares on Debian Linux December 7, 2023
  • Anonymous Browsing 101: A Deep Dive Into Residential Proxies November 20, 2023
  • How To Correctly Install Uninstall Linux Ubuntu Nvidia Drivers Fast October 31, 2023
  • Ethical Web Design: The Dos and Don’ts October 28, 2023
  • Understanding the Role of Security Operations Center October 25, 2023
  • The Positive Effects of AI Tools and Online Services on Students Successful Essay-Writing Skills October 3, 2023

Categories

  • Android
  • Apple
  • Blogs
  • Debian
  • Fix
  • Gadgets
  • Game
  • Google
  • How To Ubuntu
  • Internet
  • Laptops
  • Linux
  • Linux Commands
  • Linux Game
  • Linux Mint
  • News
  • Operating Systems
  • Security
  • Technology
  • Themes
  • Tools
  • Tutorials
  • Ubuntu
  • ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Windows 11
  • Wordpress

Tags

android apps centos ChatGPT command Commands Debian deepin Desktop docker Fedora fix game games Gaming gnome google kernel linux linux commands linux kernel Linux laptops Linux Mint Linux themes minecraft NVIDIA Python Raspberry Pi sysadmin themes ubuntu ubuntu 18.04 Ubuntu 18.04 LTS Ubuntu 20.04 ubuntu 20.04 lts Ubuntu 22.04 LTS Ubuntu games Ubuntu kernel ubuntu themes ubuntu tutorial VirtualBox Windows Windows 11 Wine WSL
itsubuntu.com is an Equal Opportunity Employer. For Advertisement, Jobs, Guest posts, and any other thoughts, email us at info@itsubuntu.com
  • Writer/Journalist Internship

    • Ellensburg, WA
    • The Borgen Project
    • Internship
  • Remote Federal Appellate Brief Writer, Performance-Based Pay

    • East Brunswick, NJ
    • National Organization of Social Security Claimants' Represen...
    • Full Time
  • Principal Data Scientist: Associate AI experience

    • Sunnyvale, CA
    • Walmart
    • Full Time
  • Solutions Architecture Senior Advisor

    • Dallas, TX
    • NTT DATA
    • Full Time
  • Azure Architect

    • Remote
    • Openkyber
    • Full Time
  • Azure Architect

    • North Carolina
    • Openkyber
    • Full Time
  • Azure Infrastructure

    • Avon Lake, OH
    • Staffingine LLC
    • Temporary
  • Azure Engineer

    • Iselin, NJ
    • HAN Staffing
    • Full Time

Copyright © 2026 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme