In this post, you will learn how to install Apache2 + PHP 7.2 + Joomla 3.9.21, for write this post i get two references, you checks links in the end post. let's start.
1. Update and upgrade system packages
sudo apt-get update && sudo apt-get upgrade
2. Install apache
The comands below, you need to stop, start, status, reload and enable apache2 service.
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
3. Install PHP 7.2 is not be avaible in ubuntu default repositories, for that run next commands.
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update && sudo apt-get upgrade
sudo apt install libapache2-mod-php7.2 openssl php-imagick php7.2-common php7.2-curl php7.2-gd php7.2-imap php7.2-intl php7.2-json php7.2-ldap php7.2-mbstring php7.2-mysql php7.2-pgsql php-smbclient php-ssh2 php7.2-sqlite3 php7.2-xml php7.2-zip
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
4. Check version PHP
Go to browser type this (localhost or your_ip)
http://localhost/
5. Install MariaDB
sudo apt install mariadb-server
In this command, Set the password for the root and you choose the other options that it will ask you according to what you need.
sudo mysql_secure_installation
6. Create Database for joomla
CREATE DATABASE YOUR_DATABASE_NAME;
GRANT ALL ON YOUR_DATABASE_NAME.* TO 'YOUR_USER'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD';
7. Download Joomla 3-9-21
sudo wget https://downloads.joomla.org/cms/joomla3/3-9-21/Joomla_3-9-21-Stable-Full_Package.zip
sudo mkdir /var/www/html/joomla
sudo unzip Joomla_3-9-21-Stable-Full_Package.zip -d /var/www/html/joomla
Change the permissions
sudo chown -R www-data:www-data /var/www/html/joomla
sudo chmod -R 755 /var/www/html/joomla
8. Restar apache2
sudo systemctl restart apache2
9. Configure apache for joomla
sudo nano /etc/apache2/sites-available/joomla.conf
Copy the lines into file and then crtl + o and ctrl + x.
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/joomla/
ServerName example.com
ServerAlias www.example.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/joomla/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
10. Enable Virtual host
sudo a2ensite joomla.conf
sudo systemctl restart apache2
11. Great the joomla stand up on Ubuntu 20, check
First configuration general add your Site Name, Description, email, username i recomend wrote the same and the last add password
Second Database configuration, choose MySQLI, Hostname: localhost, username: YOUR_USER, password: YOUR_PASSWORD, Database Name: YOUR_DATABASE_NAME
And in the end, only check your configuration, and then click 'install'
12. If the installation is success then you will get notification.
13. Click Remove installation folder, is mandatory.
14. Click on button 'Administrator'
Open the login, write your username and your passoword.
Great, you install joomla on ubuntu 20.
References:
https://www.tecmint.com/install-joomla-on-ubuntu/
https://websiteforstudents.com/apache2-with-php-7-1-support-on-ubuntu-18-04-lts-beta-server/