How to Install Joomla with Apache and free Let's Encrypt SSL on Alma Linux 8
Joomla is a free, open-source, and one of the most popular Content Management systems. It is written in PHP and used to create websites and blogs without any programming knowledge. It provides free and paid plugins and themes that help you to extend the website functionality. It provides an initiative control panel for managing websites from the web browser. Joomla provides very useful features including, multi-language support, media manager, SEO, an integrated help system, contact management, and many more.
In this tutorial, you will learn how to install Joomla CMS with Apache and Let's Encrypt SSL on Alma Linux 8.
Prerequisites
- A server running Alma Linux 8.
- Valid domain name pointed with your server IP.
- A root password is configured on the server.
Install LAMP Server
Joomla runs on the webserver, written in PHP, and uses MariaDB as a database backend. So you will need to install the LAMP Server on your system. You can install it with the following command:
dnf install httpd @mariadb php php-curl php-xml php-zip php-mysqlnd php-intl php-gd php-json php-ldap php-mbstring php-opcache unzip curl wget -y
Once the installation is completed, edit the PHP configuration file and change the default settings:
nano /etc/php.ini
Change the following lines:
memory_limit = 256M output_buffering = Off max_execution_time = 300 date.timezone = UTC
Save and close the file then start the Apache service and enable it to start after the system reboot:
systemctl start httpd mariadb
systemctl enable httpd mariadb
Configure MariaDB Database
Next, you will need to create a database and user for Joomla CMS. First, connect to the MariaDB shell with the following command:
mysql
Once you are logged in, create a database and user with the following command:
MariaDB [(none)]> CREATE DATABASE joomla;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON joomla.* TO 'joomla'@'localhost' IDENTIFIED BY "securepassword";
Next, reload the privileges to apply the changes:
MariaDB [(none)]> FLUSH PRIVILEGES;
Next, exit from the MariaDB shell with the following command:
MariaDB [(none)]> EXIT;
Once you are finished, you can proceed to the next step.
Download Joomla CMS
At the time of writing this tutorial, the latest available version is Joomla 4.1.2. You can download it from their official download page with the following command:
wget https://downloads.joomla.org/cms/joomla4/4-1-2/Joomla_4-1-2-Stable-Full_Package.zip?format=zip -O joomla.zip
Once the download is completed, unzip the downloaded file to the Apache web root directory using the following command:
unzip joomla.zip -d /var/www/html/joomla
Next, change the ownership and permission of the Joomla directory:
chown -R apache:apache /var/www/html/joomla/
chmod -R 775 /var/www/html/joomla/
Once you are completed, you can proceed to the next step.
Configure Apache for Joomla
Next, you will need to create an Apache virtual host configuration file for Joomla. You can create it with the following command:
nano /etc/httpd/conf.d/joomla.conf
Add the following codes:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/var/www/html/joomla" ServerName joomla.example.com ErrorLog "/var/log/httpd/example.com-error_log" CustomLog "/var/log/httpd/example.com-access_log" combined <Directory "/var/www/html/joomla"> DirectoryIndex index.html index.php Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>
Save and close the file then restart the Apache service to apply the configuration changes:
systemctl restart httpd
You can now check the status of the Apache webserver with the following command:
systemctl status httpd
You will get the following output:
? httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/httpd.service.d ??php-fpm.conf Active: active (running) since Fri 2022-04-15 08:52:59 UTC; 3s ago Docs: man:httpd.service(8) Main PID: 4749 (httpd) Status: "Started, listening on: port 80" Tasks: 213 (limit: 11412) Memory: 24.3M CGroup: /system.slice/httpd.service ??4749 /usr/sbin/httpd -DFOREGROUND ??4751 /usr/sbin/httpd -DFOREGROUND ??4752 /usr/sbin/httpd -DFOREGROUND ??4753 /usr/sbin/httpd -DFOREGROUND ??4754 /usr/sbin/httpd -DFOREGROUND Apr 15 08:52:59 linux systemd[1]: httpd.service: Succeeded. Apr 15 08:52:59 linux systemd[1]: Stopped The Apache HTTP Server. Apr 15 08:52:59 linux systemd[1]: Starting The Apache HTTP Server...
Once you are finished with the Apache configuration, you can proceed to the next step.
Configure Firewall for Joomla
Next, you will need to allow HTTP and HTTPS services through the firewall. You can allow them with the following command:
firewall-cmd --add-service=http --zone=public --permanent
firewall-cmd --add-service=https --zone=public --permanent
Next, reload the firewalld to apply the changes:
firewall-cmd --reload
Access Joomla Web Installation Wizard
Now, open your web browser and access the Joomla installation using the URL http://joomla.example.com. You will be redirected to the following screen:
Select your language, provide your website name then click on the Setup Login Data. You should see the admin configuration screen:
Provide your admin username, password and click on the Setup Database Connection. You should see the following screen:
Provide your database name, username, password, and click on the Install Joomla button. Once the Joomla is installed, you should see the following screen:
Click on the Open Administrator button. You should see the Joomla login screen:
Provide your admin username, password and click on the Log in button. You should see the Joomla dashboard on the following screen:
Secure Joomla CMS with Let's Encrypt SSL
Next, you will need to install the Certbot client to install the Let's Encrypt SSL for your website. You can install it with the following command:
dnf install epel-release -y
dnf install certbot python3-certbot-apache
Next, obtain and install an SSL certificate for your lets domain with the following command:
certbot --apache -d joomla.example.com
You will be asked to provide your email address and accept the term of service:
Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator apache, Installer apache Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): [email protected] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must agree in order to register with the ACME server. Do you agree? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing, once your first certificate is successfully issued, to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y Account registered. Requesting a certificate for joomla.example.com Performing the following challenges: http-01 challenge for joomla.example.com Waiting for verification... Cleaning up challenges Deploying Certificate to VirtualHost /etc/httpd/conf.d/joomla.conf Redirecting all traffic on port 80 to ssl in /etc/httpd/conf.d/joomla.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations! You have successfully enabled https://joomla.example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Subscribe to the EFF mailing list (email: [email protected]). IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/joomla.example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/joomla.example.com/privkey.pem Your certificate will expire on 2022-07-09. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
Conclusion
Congratulations! You have successfully installed Joomla CMS with Apache and Let's Encrypt SSL on Alma Linux 8. Using wonderful Joomla CMS, you can now build your own website without any programming or coding knowledge. Please don't hesitate to ask if you have any queries.