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:  Ubuntu 20.04 LTS Released : Download Now [ISO]

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

Ubuntu 16.04.7 LTS And Ubuntu 18.04.5 LTS Point Version Released Ubuntu
List Of Useful Apps For Ubuntu 20.04 LTS in 2021 List Of Useful Apps For Ubuntu 20.04 LTS [For Beginner] Ubuntu 20.04
9+ Best Linux Screen Recorder On Ubuntu 20.04 LTS 9+ Best Linux Screen Recorder On Ubuntu 20.04 LTS Ubuntu 20.04
Configure Universe, Multiverse And Restricted repo On Ubuntu 20.04 LTS Configure Universe, Multiverse And Restricted repo On Ubuntu 20.04 LTS Linux Commands
Install PostgreSQL On Ubuntu Linux Install PostgreSQL On Ubuntu Linux Ubuntu
How To Install Canon Printer Driver In Ubuntu 20.04 How To Install Canon Printer Driver In Ubuntu 20.04 Ubuntu 20.04

Leave a Reply Cancel reply

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

Recent Posts

  • 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
  • Linux Wget Examples September 27, 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
  • Search Jobs
  • Post a Job
  • Job Dashboard
  • Contact Us
  • About US
  • Cookie Policy
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
  • Write For US

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 [email protected]
  • TV Writer

    • New York, NY
    • SPECTRUM
    • Full Time
  • Technical Writer

    • Chantilly, Loudoun County, VA
    • ManTech
    • Full Time
  • Technical Documentation Specialist

    • Peoria, IL
    • EPITEC
    • Full Time
  • Technical Writer

    • Swiftwater, PA
    • Cynet Systems Inc.
    • Full Time
  • Senior Technical Writer

    • San Diego, CA
    • Compunnel Inc.
    • Full Time
  • Technical Writer

    • Crane, IN
    • Bowhead / UIC Technical Services
    • Full Time
  • Senior Data Scientist

    • Waltham, MA (Remote)
    • Global Partners LP
    • Full Time
  • Communications Writer

    • Lynchburg, VA
    • Patrick Henry Family Services Operations, Inc.
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme