YouTube Icon

Code Playground.

How to Install Joomla with Apache on Ubuntu 18.04

CFG

How to Install Joomla with Apache on Ubuntu 18.04

Joomla is one of the most mainstream open-source content administration frameworks that powers a huge number of sites. It is written in PHP and packs a huge load of highlights that can be stretched out with free and premium expansions and topics. With Joomla, you can undoubtedly manufacture your eCommerce store, individual site, social webpage or blog. 

In this instructional exercise, we will disclose how to introduce Joomla on Ubuntu 18.04. We'll be utilizing a LAMP stack with Apache as a web worker, SSL endorsement, the most recent PHP 7.2 and MySQL/MariaDB as an information base worker. 

Prerequisites

Guarantee the accompanying requirements are met prior to proceeding with this instructional exercise: 

Have a space name highlighting your worker public IP. We will utilize example.com. 

Signed in as a client with sudo advantages . 

Apache introduced by adhering to these guidelines . 

You have a SSL authentication introduced for your space. You can introduce a free Let's Encrypt SSL testament by adhering to these guidelines . 

Creating a MySQL database

Joomla can store its information, for example, articles, classes, clients, expansions and topics settings in a MySQL, PostgreSQL or MS SQL information base. 

We'll utilize MySQL as the back-end information base. On the off chance that you don't have MySQL introduced on your Ubuntu worker you can introduce it by composing: 

sudo apt-get update
sudo apt-get install mysql-server

Login to the MySQL reassure by composing: 

sudo mysql

From inside the MySQL shell, run the accompanying SQL explanation to make an information base : 

CREATE DATABASE joomla CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

Next, make another MySQL client and award advantages to this client on the new information base: 

GRANT ALL ON joomla.* TO 'joomlauser'@'localhost' IDENTIFIED BY 'change-with-strong-password';

When done, leave the mysql support by composing: 

EXIT

Installing PHP

PHP 7.2 which is the default PHP form in Ubuntu 18.04 is completely upheld and suggested for Joomla. 

Introduce PHP all necessary PHP expansions with the accompanying order: 

sudo apt update
sudo apt install php7.2 php7.2-cli php7.2-mysql php7.2-json php7.2-opcache php7.2-mbstring php7.2-intl php7.2-xml php7.2-gd  php7.2-zip php7.2-curl php7.2-xmlrpc php7.2-xmlrpc

Set the suggested PHP alternatives by altering the php.ini record with sed : 

sudo sed -i "s/memory_limit = .*/memory_limit = 512M/" /etc/php/7.2/apache2/php.ini
sudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 256M/" /etc/php/7.2/apache2/php.ini
sudo sed -i "s/post_max_size = .*/post_max_size = 256M/" /etc/php/7.2/apache2/php.ini
sudo sed -i "s/output_buffering = .*/output_buffering = Off/" /etc/php/7.2/apache2/php.ini
sudo sed -i "s/max_execution_time = .*/max_execution_time = 300/" /etc/php/7.2/apache2/php.ini
sudo sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.2/apache2/php.ini

Restart apache so the recently introduced PHP augmentations are stacked: 

sudo systemctl restart apache2

Downloading Joomla

At the hour of composing this article, the most recent form of Joomla is adaptation 3.9.4. 

Prior to downloading the Joomla chronicle, first make an index that will hold the Joomla documents and explore to it: 

sudo mkdir -p /var/www/example.com
cd /var/www/example.com

Next, download the current arrival of Joomla from the Joomla downloads page utilizing the accompanying wget order : 

sudo wget https://downloads.joomla.org/cms/joomla3/3-9-4/Joomla_3-9-4-Stable-Full_Package.zip

Once the download is finished, unfasten the chronicle and move the records into the area's report root registry: 

sudo unzip Joomla_3-9-4-Stable-Full_Package.zip

Change the catalog's proprietor to www-information utilizing the chown order so the web worker can have full admittance to the website's documents and registries: 

sudo chown -R www-data: /var/www/example.com

Configuring Apache

At this point, you should as of now have Apache with SSL declaration introduced on your framework, if not check the requirements for this instructional exercise. 

The following stage is to alter the Apache virtual hosts setup: 

sudo nano /etc/apache2/sites-available/example.com.conf

The accompanying Apache setup [redirects HTTP to HTTPS] and www to non-www variant of your area and empowers HTTP2. Remember to supplant example.com with your Joomla space and set the right way to the SSL authentication documents. 

/etc/apache2/sites-available/example.com.conf

<VirtualHost *:80>
  ServerName example.com
  ServerAlias www.example.com

  Redirect permanent / https://example.com/
</VirtualHost>

<VirtualHost *:443>
  ServerName example.com
  ServerAlias www.example.com

  Protocols h2 http/1.1

  <If "%{HTTP_HOST} == 'www.example.com'">
    Redirect permanent / https://example.com/
  </If>

  DirectoryIndex index.html index.php
  DocumentRoot /var/www/example.com

  ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
  CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined

  SSLEngine On
  SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
  SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem

  <Directory /var/www/example.com>
      Options FollowSymLinks
      AllowOverride All
      Require all granted
  </Directory>

</VirtualHost>

If not empowered, empower the virtual host for the space. This order will make a representative connection from the locales accessible to the destinations empowered catalog: 

sudo a2ensite example.com

For the new setup to produce results, restart the Apache administration by composing: 

sudo systemctl restart apache2

Completing the Joomla Installation

Since Joomla is downloaded and the worker design is finished, the time has come to conclude the Joomla establishment utilizing the web interface. 

Open your program, type your area and a screen like the accompanying will show up: 

Select the language you might want to utilize and fill in the accompanying data: 

Webpage Name - The name of your new Joomla site. 

Portrayal - Description of the site. This is a fallback meta depiction that will be utilized on each page without a particular portrayal. 

Administrator Email Address - The managerial client email address. Utilize a substantial email. In the event that you fail to remember your secret word you'll get a connection to change the secret word at this email address. 

Administrator Username - The username of the regulatory client. For security purposes, set the username to something different than "administrator". 

Administrator Password - The regulatory client secret phrase. Ensure you utilize a solid secret word. Enter a similar secret key in the Confirm Admin Password field. 

Site Offline - Leave the default "No". On the off chance that you select "Yes", when the establishment is finished, the site will show "Site is disconnected". 

At the point when completed, click on the "Following" button. 

On the following screen, the arrangement wizard will request that you enter your information base association subtleties. 

Information base Type - Leave the default "MySQLi". 

Hostname - Leave the default "localhost". On the off chance that this instructional exercise the information base is situated on a similar worker. 

Username, Password, Database Name - Enter the MySQL client and information base subtleties you recently made. 

Table Prefix - Leave the naturally created prefix. 

Old Database Process - Leave the default "Reinforcement" alternative. 

When you click on the "Following" button you'll be diverted to the Overview page: 

Here you can choose to introduce test information and confirm that all checks are passed. Snap on the Install button and once the establishment is finished you will be taken to a page advising you that Joomla has been introduced. 

On the off chance that you need to introduce extra dialects click on the "Additional means: Install dialects" button. 

For security reasons, you'll have to erase the establishment index. To do as such, return to the terminal and run the accompanying rm order: 

sudo rm -rf /var/www/example.com/installation

To get to your Joomla back-end click on the Adminstrator button. From here, you can begin modifying your Joomla establishment by putting in new subjects and modules. 

Conclusion

Congrats, you have effectively introduced Joomla with Apache on your Ubuntu 18.04 worker. Joomla Documentation is a decent beginning spot to study how to begin with your new Joomla site. 

In the event that you have questions, don't hesitate to leave a remark beneath.




CFG