bookmark_borderInstalling Composer on Rocky Linux 9

Hello,

In this week’s feature highlight, we look at How to How to Install Composer on Rocky Linux 9

Composer is a dependency manager for the programming language, PHP. It functions as some sort of project manager that helps the programmer manage dependencies that will be used on a project-to-project basis.

Installing PHP

Install PHP using the dnf package manager as shown below,

dnf install php

Output:

[root@server ~]# dnf install php
Last metadata expiration check: 2:53:03 ago on Tue 19 Jul 2022 08:34:16 PM CEST.
Package php-8.0.13-1.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Download Composer Installer

Install wget package to download files from the internet.

dnf -y install wget

Download the installer file from their official site using the wget command as shown below,

wget https://getcomposer.org/installer -O composer-installer.php

Output:

[root@server ~]#     wget https://getcomposer.org/installer -O composer-installer.php
--2022-07-19 23:29:07--  https://getcomposer.org/installer
Resolving getcomposer.org (getcomposer.org)... 54.36.53.46, 2001:41d0:302:1100::8:104f
Connecting to getcomposer.org (getcomposer.org)|54.36.53.46|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 58140 (57K) [application/octet-stream]
Saving to: ‘composer-installer.php’

composer-installer.php        100%[=================================================>]  56.78K  --.-KB/s    in 0.009s

2022-07-19 23:29:08 (6.32 MB/s) - ‘composer-installer.php’ saved [58140/58140]

Installing PHP Composer

Run the downloaded composer installation file with the below command,

php composer-installer.php --filename=composer --install-dir=/usr/local/bin 

Output:

[root@server ~]# php composer-installer.php --filename=composer --install-dir=/usr/local/bin
All settings are correct for using Composer
Downloading...

Composer (version 2.3.10) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Verify the PHP Composer version once the installation is done

composer --version

Output:

[root@server ~]# composer --version
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? y
Composer version 2.3.10 2022-07-13 15:48:23

Testing Composer

To test your installation, run the following command.

composer

Output:

[root@server ~]# composer
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? y
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 2.3.10 2022-07-13 15:48:23

Usage:
  command [options] [arguments]

bookmark_borderInstalling Let’s Encrypt SSL with LAMP Stack on Rocky Linux 9

Hello,

In this week’s feature highlight, we look at How to Install Let’s Encrypt SSL with LAMP Stack on Rocky Linux 9


Let’s Encrypt is a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security encryption at no charge. In this article, we are going to learn how to install Let’s Encrypt SSL on Rocky Linux 9. So, let’s get started.

Checkout the Let’s Encrypt SSL Project Here.

Get started with $5 VPS from CrownCloud. Check our latest offers : CrownCloud VPS [ 24×7 In-House Customer Support ]

Pre-requisites :

  • A system with Rocky Linux 9 installed and running.
  • root access to the system.
  • A domain with appropriate DNS records set (usually an “A” record with a value of the server’s IP address).
  • LAMP Stack installed and running, for this, you can refer to one of our guides on installing the LAMP Stack (Apache, MariaDB, and PHP).

Once you’re all set, we’ll proceed with Let’s Encrypt SSL installation and configuration.

Install snapd

We will install the snapd tool for installing and setting up the snaps. Run the below command,

dnf install snapd

Update the Snap with the below commands,

snap install core
snap refresh core

Run the below commands to start and enable the Snap upon boot.

systemctl start snapd.socket

systemctl enable snapd.socket

To check status

systemctl status snapd.socket

Enable the classic snap support by creating a symbolic link from /var/lib/snapd/snap to /snap with the command below:

ln -s /var/lib/snapd/snap /snap

Install Certbot using Snap

We will install Certbot using the Snap package. For this, we need the Snap installed with the below command:

snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot

Configuring Apache vHost

Create a new apache configuration file blog.domainhere.info.conf for the domain with the following command:

nano /etc/httpd/conf.d/blog.domainhere.info.conf

Add the following codes:

  <VirtualHost *:80>
  ServerName blog.domainhere.info
  ServerAlias blog.domainhere.info
  DocumentRoot /var/www/html

  <Directory /var/www/html/>
      Options -Indexes +FollowSymLinks
      AllowOverride All
  </Directory>

  ErrorLog /var/log/httpd/blog.domainhere.info-error.log
  CustomLog /var/log/httpd/blog.domainhere.info-access.log combined
  </VirtualHost>

Change blog.domainhere.info with Your Domain Name.

Now, restart & check the apache with the following commands:

systemctl restart httpd

systemctl status httpd

Enable Firewall:

firewall-cmd --permanent --add-service=http

firewall-cmd --permanent --add-service=https

firewall-cmd --reload

Generating Let’s Encrypt SSL

Generate Let’s Encrypt SSL with the following command.

dnf install mod_ssl

certbot --apache

Output:

[root@server ~]# certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): username@mail.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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.

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: blog.domainhere.info
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Requesting a certificate for blog.domainhere.info

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/blog.domainhere.info/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/blog.domainhere.info/privkey.pem
This certificate expires on 2022-08-23.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for blog.domainhere.info to /etc/httpd/conf.d/blog.domainhere.info-le-ssl.conf
Congratulations! You have successfully enabled HTTPS on https://blog.domainhere.info

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[root@server ~]#

Now, navigate to your browser and load your website with https,

(https://your.domainname.com)

You can notice a lock icon suggesting that your connection between the browser and the server is encrypted.

Now you have successfully installed Let’s Encrypt SSL with LAMP Stack on Rocky Linux 9.

bookmark_borderInstalling Joomla with LAMP Stack on Rocky Linux 9

Hello,

In this week’s feature highlight, we look at How to Install Joomla with LAMP Stack on Rocky Linux 9

Joomla is a free and open-source content management system for publishing web content on websites. Web content applications include discussion forums, photo galleries, e-Commerce, user communities, and numerous other web-based applications. In this article, we are going to learn how to install Joomla on Rocky Linux 9. So, let’s get started.

Checkout the Joomla Project Here.

Try this wiki on our VPS. Starting at just $5/month with 24×7 In-house customer support.

Pre-requisites :

  • A system with Rocky Linux 9 installed and running.
  • root access to the system.
  • LAMP Stack installed and running, for this, you can refer to one of our guides on installing the LAMP Stack (Apache, MariaDB, and PHP).

Once you’re all set, we’ll proceed with Joomla installation and configuration.

Create Database

Let us begin with creating a Database and a user. We will then grant the required privileges to the user so it can interact with the Database.

mysql -u root

CREATE DATABASE owncloud_db;

CREATE USER 'owncloud_user'@'localhost' IDENTIFIED BY 'YOUR-PASSWORD-HERE';

GRANT ALL PRIVILEGES ON owncloud_db.* TO 'owncloud_user'@'localhost';

FLUSH PRIVILEGES;

QUIT

The above commands will give complete access to the user owncloud_user. Replace YOUR-PASSWORD-HERE with a safe and secure password.

Install Let’s Encrypt SSL Certificate

Next, we will install the Let’s Encrypt SSL cert so we can have the domain running on HTTPS.
You can refer the following link for instructions on how to Install Let’s Encrypt.

Download Joomla

Download Joomla from official website : Click here.

https://downloads.joomla.org/cms/joomla4/4-1-5/Joomla_4-1-5-Stable-Full_Package.zip?format=zip -O joomla.zip

unzip joomla.zip

rm joomla.zip

Setting up File Permissions

Let’s make the folders readable.

chown -R apache:apache /var/www/html/joomla

chmod -R 755 /var/www/html/joomla

chcon -R -t httpd_sys_content_rw_t /var/www/html/joomla

Configuring Apache vHost

Create a new apache configuration file blog.domainhere.info.conf for the domain with the following command:

vi /etc/httpd/conf.d/blog.domainhere.info.conf

Add the following codes:

<VirtualHost *:80>

ServerName blog.domainhere.info
ServerAlias blog.domainhere.info
DocumentRoot /var/www/html/joomla

<Directory /var/www/html/joomla/>
    Options -Indexes +FollowSymLinks
    AllowOverride All
</Directory>

ErrorLog /var/log/httpd/blog.domainhere.info-error.log
CustomLog /var/log/httpd/blog.domainhere.info-access.log combined

</VirtualHost>

Change blog.domainhere.info with Your Domain Name.

Now, press the Esc key, type :wq! and press the Enter key to save and exit the file.

Now, restart & check the apache with the following commands:

systemctl restart httpd

systemctl status httpd

Enable Firewall:

firewall-cmd --permanent --add-service=http

firewall-cmd --permanent --add-service=https

firewall-cmd --reload

Configuring Joomla

Now open the URL from your browser, this will redirect you to configuring the final parts of the Joomla installation.

https://blog.domainhere.info/

Replace the blog.domainhere.info with the actual IP or domain configured on the server.

Input the Database details which was configured earlier. Follow the below steps:

Now you have successfully installed Joomla with LAMP Stack on Rocky Linux 9.