Joomla is an open-source CMS (Content Management System) primarily written in PHP programming language due to its scripting prowess.
It is characterized as free and open source to imply that any user who wishes to benefit from its usage has full control. Therefore, if you are interested in creating a blog/news/content site for a business or as a personal project, Joomla is an ideal candidate.
Prerequisites
Ensure you have root/sudoer user privileges on the RHEL 8 system you are using.
Installing Apache Web Server in RHEL
Make sure the RHEL 8 system you are using is up-to-date for it to meet the needed performance requirements.
$ sudo dnf update && sudo dnf upgrade -y
Your Joomla CMS site will need to be served under a performant web server like Apache. Proceed and install it with the following command:
$ sudo dnf install httpd httpd-tools
Once installed, you can start, enable, and check on the status of your web server.
$ sudo systemctl start httpd $ sudo systemctl enable httpd $ sudo systemctl status httpd
Installing PHP in RHEL
To install the most recent version of PHP 8, you need to enable EPEL and Remi repositories as shown.
$ sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm $ sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Next, you need to list, reset and enable the latest PHP module as shown.
$ sudo dnf module list php $ sudo dnf module reset php $ sudo dnf module enable php:remi-8.1
Finally, install PHP 8 along with its extensions.
$ sudo dnf install php php-opcache php-gd php-curl php-mysqlnd php-mbstring php-xml php-pear php-fpm php-mysql php-pdo php-json php-zip php-common php-cli php-xmlrpc php-xml php-tidy php-soap php-bcmath php-devel
Once installed, you can start, enable, and check on the status of your php-fpm service.
$ sudo systemctl start php-fpm $ sudo systemctl enable php-fpm $ sudo systemctl status php-fpm
Enable Selinux for PHP execution.
$ sudo setsebool -P httpd_execmem 1
Installing MariaDB in RHEL
A database server is critical for storing user and system-generated data.
$ sudo yum install mariadb-server
Once installed, you can start, enable, and check on the status of your MariaDB database server.
$ sudo systemctl start mariadb $ sudo systemctl enable mariadb $ sudo systemctl status mariadb
Next, you need to secure your MariaDB installation using the following security script.
$ sudo mysql_secure_installation
It is through this command that you can choose to set the database root password and other pre-configurations.
Creating Joomla Database in RHEL
Login to the MariaDB database and create a Joomla user, database, and grant the user the required database permissions.
$ mysql -u root -p MariaDB [(none)]> CREATE USER joomla@localhost IDENTIFIED BY "Your_preferred_joomla_user_password"; MariaDB [(none)]> CREATE DATABASE joomla_db; MariaDB [(none)]> GRANT ALL ON joomla_db.* TO joomla@localhost; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> exit
Install Joomla CMS in RHEL
Download the latest version of Joomla CMS from its official site or use the following wget command.
$ wget https://downloads.joomla.org/cms/joomla4/4-1-0/Joomla
Next, extract joomla to /var/www/html/joomla folder/directory and set directory ownership and permission.
$ sudo mkdir -p /var/www/html/joomla $ sudo tar -xvf joomla.tar.gz -C /var/www/html/joomla $ sudo chown -R apache:apache /var/www/html/joomla/ $ sudo chmod -R 755 /var/www/html/joomla/
Next, create and configure Joomla virtual host on Apache.
$ sudo nano /etc/httpd/conf.d/joomla.conf
Add the following virtual host configuration.
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/joomla/ ServerName linuxshelltips.network ServerAlias www.linuxshelltips.network 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>
Save and close the file and then check the apache configuration file’s syntax for errors.
$ sudo apachectl -t
Configure Selinux to allow execution of PHP scripts of Joomla.
$ sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/joomla(/.*)?" $ sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/joomla/installation/configuration.php-dist $ sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/joomla/installation' $ sudo restorecon -Rv /var/www/html/joomla $ sudo restorecon -v /var/www/html/joomla/installation/configuration.php-dist $ sudo restorecon -Rv /var/www/html/joomla/installation $ sudo chown -R apache:apache /var/www/html/joomla
Finally, restart the Apache webserver.
$ sudo systemctl restart httpd
Finalize Joomla CMS Installation
Access the domain name you configured for Joomla from your browser.
http://linuxshelltips.lan.network
The first step is to set up your site name:
Enter your Joomla login data on the next screen capture:
The next screen will require you to set up a database connection based on the MariaDB credentials you created earlier.
Hit the install button and your Joomla CMS site should start installing.
Be patient as the installation process might take some time to complete. You can afterward log in to your new Joomla CMS site and configure it to your liking.
Your RHEL 8 machine is now ready to embrace Joomla CMS.
For updates from Joomla.org the SELinux needs this setting:
# setsebool -P ‘httpd_can_network_connect’ on