bookmark_borderInstalling OwnCloud on Rocky Linux 8

Hello,

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

OwnCloud is an open source project that can be installed on your server to securely store and access files. Also allows you to share and collaborate contents that lets teams work on data easily from anywhere, on any device.

Find out more about OwnCloud.

Prerequisites

Before we begin with installing ownCloud, you would need either a LAMP or LEMP Stack installed and running on your server or home computer.

To install and configure LAMP Stack, Click here.

To install and configure LEMP Stack, Click here.

Updating your system

Before we begin, we will make sure our system is upto date and install any pending updated

yum update -y

Downloading OwnCloud

You can download the latest version of ownCloud by checking their downloads section.

Download ownCloud and extract it using the following command.

cd /tmp 

wget https://download.owncloud.org/community/owncloud-complete-20210326.tar.bz2

Now extract the owcloud tar file to /var/www/html/ directory.

yum install bzip2

tar -xvf owncloud-complete-20210326.tar.bz2 -C /var/www/html/

Set the permissions of owncloud directory so it can be accessible.

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

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

Create a new MySQL database

mysql -u root -p

mysql> CREATE DATABASE ownclouddb;

mysql> GRANT ALL PRIVILEGES ON ownclouddata.* TO 'ownclouduser'@'localhost' IDENTIFIED BY 'YOUR-PASSWORD' WITH GRANT   
OPTION;

mysql> FLUSH PRIVILEGES;

mysql> exit;

Note : Replace YOUR-PASSWORD with the actual password

Output:

[root@server tmp]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.3.28-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE ownclouddb;
Query OK, 1 row affected (0.004 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON ownclouddata.* TO 'ownclouduser'@'localhost' IDENTIFIED BY 'ENTER YOUR-PASSWORD' WITH GRANT
    -> OPTION;
Query OK, 0 rows affected (0.004 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.006 sec)

MariaDB [(none)]> exit;
Aborted
[root@server tmp]#

Configuring Firewall and SELinux

Open the port in firewall using following command.

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

Next, we’ll update the SELinux configuration file.

Set SELinux mode to permissive by running the following command.

setenforce 0

Open the file using your preferred editor,

vi /etc/selinux/config

And update the settings as shown below,

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
  SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
  SELINUXTYPE=targeted

If SELinux is enabled and running, execute the command below to allow the Apache webserver to write to Owncloud’s directory.

setsebool -P httpd_unified 1

Now type your IP address in the URL to complete the ownCloud installation.

http://server_IP/owncloud

You will have to create admin account for ownCloud

Enter the username and password which you want to set.

images

Click on the Finish setup button.

images

Done!

bookmark_borderInstalling Node.js on Rocky Linux 8

Hello,

In this week’s feature highlight, we look at How to Install Node.js on Rocky Linux 8


Node.js is a JavaScript runtime environment and it is primarily used for non-blocking, event-driven servers, due to its single-threaded nature. It’s used for traditional websites and back-end API services but was designed with real-time, push-based architectures. It offers users the ability to write websites in JavaScript whose code executes on the server instead of a client’s browser.

First, check for the update to keep the server up to date.

yum update -y

Installing Node.js

To list the available Node.js streams.

yum module list nodejs

Output:

[root@server ~]# yum module list nodejs
Last metadata expiration check: 2:07:57 ago on Thu 13 May 2021 01:00:13 PM EDT.
Rocky Linux 8 - AppStream
Name      Stream    Profiles                                Summary
nodejs    10 [d]    common [d], development, minimal, s2i   Javascript runtime
nodejs    12        common [d], development, minimal, s2i   Javascript runtime
nodejs    14        common [d], development, minimal, s2i   Javascript runtime

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Command to Install Node.js.

yum module install nodejs:14

Output:

[root@server ~]# yum module install nodejs:14
Last metadata expiration check: 2:08:28 ago on Thu 13 May 2021 01:00:13 PM EDT.
Dependencies resolved.
================================================================================
 Package       Arch   Version                                   Repo       Size
================================================================================
Installing group/module packages:
 nodejs        x86_64 1:14.16.0-2.module+el8.3.0+100+234774f7   appstream  11 M
 npm           x86_64 1:6.14.11-1.14.16.0.2.module+el8.3.0+100+234774f7
                                                                appstream 3.7 M
Installing weak dependencies:
 nodejs-docs   noarch 1:14.16.0-2.module+el8.3.0+100+234774f7   appstream 7.9 M
 nodejs-full-i18n

Verify the installed Node.js version using the command,

node -v 

Output:

[root@server ~]# node -v
v14.16.0

This Concludes how you install Node.js on Rocky Linux 8. Now you can begin using it to host your website, along with using npm to install any necessary JavaScript packages.

Uninstalling Node.js

If you can not configure and face any technical difficulties, kindly reach out to us via Support Ticket.

If you wish to uninstall Node.js and npm packages, you can run the command,

yum module remove nodejs

Output:

[root@server ~]# yum module remove nodejs
Last metadata expiration check: 0:24:44 ago on Thu 13 May 2021 04:00:27 PM EDT.
Dependencies resolved.
================================================================================
 Package      Arch   Version                                   Repository  Size
================================================================================
Removing:
 nodejs       x86_64 1:14.16.0-2.module+el8.3.0+100+234774f7   @appstream  36 M
 npm          x86_64 1:6.14.11-1.14.16.0.2.module+el8.3.0+100+234774f7
                                                               @appstream  15 M
Removing unused dependencies:
 nodejs-docs  noarch 1:14.16.0-2.module+el8.3.0+100+234774f7   @appstream  60 M

To verify that node.js is uninstalled you can run the following command,

node --version

Output:

[root@server ~]# node --version
-bash: node: command not found

bookmark_borderInstalling PHP 7.x on Rocky Linux 8

Hello,

In this week’s feature highlight, we look at How to Install PHP 7 x on Rocky Linux 8

Installing the EPEL and Remi Repository

For this we use the PHP 7.x packaged by Remi, a third-party repository which offers multiple versions of PHP 7.x and 8.x

First, lets install the EPEL repository,

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Next, install the Remi repository with the following command,

yum install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm

List the available PHP module stream

To check/list the available PHP versions, use the following command,

yum module list php

Output:

[root@server ~]# yum module list php
Last metadata expiration check: 2:11:11 ago on Wed 12 May 2021 11:54:38 AM EDT.
Rocky Linux 8 - AppStream
Name     Stream         Profiles                       Summary
php      7.2 [d][e]     common [d], devel, minimal     PHP scripting language
php      7.3            common [d], devel, minimal     PHP scripting language
php      7.4            common [d], devel, minimal     PHP scripting language

Remi's Modular repository for Enterprise Linux 8 - x86_64
Name     Stream         Profiles                       Summary
php      remi-7.2       common [d], devel, minimal     PHP scripting language
php      remi-7.3       common [d], devel, minimal     PHP scripting language
php      remi-7.4       common [d], devel, minimal     PHP scripting language
php      remi-8.0       common [d], devel, minimal     PHP scripting language

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Installing PHP 7.x

First, lets disable the old version before enabling the new one,

dnf module reset php

Output:

[root@server ~]# dnf module reset php
Last metadata expiration check: 2:11:49 ago on Wed 12 May 2021 11:54:38 AM EDT.
Dependencies resolved.
================================================================================
 Package           Architecture     Version             Repository         Size
================================================================================
Resetting modules:
 php

Transaction Summary
================================================================================

Is this ok [y/N]: y
Complete!

Below are the commands to install a specific version of PHP to your requirements,

dnf module install php:remi-7.2

dnf module install php:remi-7.3

dnf module install php:remi-7.4

dnf module install php:remi-8.0

In our case, we will install PHP 7.4 via the remi repository,

dnf module install php:remi-7.4

Output:

[root@server ~]# dnf module install php:remi-7.4
Last metadata expiration check: 2:12:20 ago on Wed 12 May 2021 11:54:38 AM EDT.
Dependencies resolved.
================================================================================
 Package            Arch        Version                 Repository         Size
================================================================================
Upgrading:
 php                x86_64      7.4.19-1.el8.remi       remi-modular      3.0 M
 php-cli            x86_64      7.4.19-1.el8.remi       remi-modular      4.6 M
 php-common         x86_64      7.4.19-1.el8.remi       remi-modular      1.2 M
 php-fpm            x86_64      7.4.19-1.el8.remi       remi-modular      1.6 M
 php-gd             x86_64      7.4.19-1.el8.remi       remi-modular       93 k
 php-json           x86_64      7.4.19-1.el8.remi       remi-modular       77 k

You can update your system and installed packages at any time by running the following command,

dnf update

Check Installed PHP Version

Now that we have installed PHP 7.4 via the remi repository, we can verify the version installed by running the php -v command,

php -v

Output:

[root@server ~]# php -v
PHP 7.4.19 (cli) (built: May  4 2021 11:06:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies

Done!

bookmark_borderInstalling Composer on Rocky Linux 8

Hello,

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

Composer is basically 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 by running the following command.

dnf install @php

Output:

[root@server ~]# dnf install @php
Last metadata expiration check: 0:50:18 ago on Thu 13 May 2021 01:00:13 PM EDT.
Dependencies resolved.
================================================================================
 Package          Arch   Version                                Repo       Size
================================================================================
Installing group/module packages:
 php-cli          x86_64 7.2.24-1.module+el8.3.0+200+280400f1   appstream 3.1 M
 php-common       x86_64 7.2.24-1.module+el8.3.0+200+280400f1   appstream 660 k
 php-fpm          x86_64 7.2.24-1.module+el8.3.0+200+280400f1   appstream 1.6 M
 php-json         x86_64 7.2.24-1.module+el8.3.0+200+280400f1   appstream  72 k
 php-mbstring     x86_64 7.2.24-1.module+el8.3.0+200+280400f1   appstream 579 k
 php-xml          x86_64 7.2.24-1.module+el8.3.0+200+280400f1   appstream 187 k

Download Composer installer

We will install wget package so we can download files over the internet, you can skip this part if you already have it installed.

dnf -y install wget

We will now download the composer from the official website

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

Output:

[root@vps ~]# wget https://getcomposer.org/installer -O composer-installer.php
--2021-02-23 12:59:23--  https://getcomposer.org/installer
Resolving getcomposer.org (getcomposer.org)... 142.44.245.229, 2607:5300:201:2100::4:d105
Connecting to getcomposer.org (getcomposer.org)|142.44.245.229|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 58460 (57K) [application/octet-stream]
Saving to: ‘composer-installer.php’

composer-installer. 100%[===================>]  57.09K  --.-KB/s    in 0.1s

2021-02-23 12:59:24 (420 KB/s) - ‘composer-installer.php’ saved [58460/58460]

Installing PHP Composer

Install the PHP Composer by running the following command.

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

Output:

[root@server ~]# wget https://getcomposer.org/installer -O composer-installer.php
--2021-05-13 13:52:13--  https://getcomposer.org/installer
Resolving getcomposer.org (getcomposer.org)... 142.44.245.229, 2607:5300:201:2100::4:d105
Connecting to getcomposer.org (getcomposer.org)|142.44.245.229|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 58460 (57K) [application/octet-stream]
Saving to: ‘composer-installer.php’

composer-installer. 100%[===================>]  57.09K  --.-KB/s    in 0.1s

2021-05-13 13:52:14 (421 KB/s) - ‘composer-installer.php’ saved [58460/58460]

Verify the PHP Composer version once installation is done

composer --version

Output:

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

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

Testing Composer

To test your installation, run the following command.

composer

Output:

[root@server ~]# composer --version
Composer version 2.0.13 2021-04-27 13:11:08
[root@server ~]# composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 2.0.13 2021-04-27 13:11:08

Usage:
  command [options] [arguments]

Done!

bookmark_borderInstalling Docker on Rocky Linux 8

Hello,

In this week’s feature highlight, we look at How to Docker on Rocky Linux 8

What is Docker?

Docker is basically a container engine which uses the Linux Kernel in order to create the containers on top of an operating system. Which is use to create, deploy and run applications in a containerized environment.

First, check and install any pending system updates.

yum update 

Adding Docker repository

Enable the Docker CE repository by running the following command.

dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

Output:

[root@vps ~]# dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo

Installing Docker-ce package

Install Docker-ce package on AlmaLinux 8 by running the following command.

dnf -y  install docker-ce --nobest

Output:

[root@server ~]# dnf -y  install docker-ce --nobest
Docker CE Stable - x86_64                        50 kB/s |  12 kB     00:00
Dependencies resolved.
================================================================================
 Package                      Arch   Version             Repository        Size
================================================================================
Installing:
 docker-ce                    x86_64 3:20.10.6-3.el8     docker-ce-stable  27 M
Installing dependencies:
 checkpolicy                  x86_64 2.9-1.el8           baseos           345 k
 container-selinux            noarch 2:2.155.0-1.module+el8.3.0+161+9c4b50ff
                                                         appstream         50 k
 containerd.io                x86_64 1.4.4-3.1.el8       docker-ce-stable  33 M
 docker-ce-cli                x86_64 1:20.10.6-3.el8     docker-ce-stable  33 M

Enable the Docker service.

systemctl enable --now docker

Output:

[root@vps ~]# systemctl enable --now docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.

Checking the Docker service

To verify the Docker service by running the following command.

systemctl status  docker

Output:

 [root@server ~]# systemctl status  docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor pres>
   Active: active (running) since Wed 2021-05-12 16:05:02 EDT; 11s ago
     Docs: https://docs.docker.com
 Main PID: 12504 (dockerd)
    Tasks: 8
   Memory: 44.1M
   CGroup: /system.slice/docker.service
           └─12504 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/conta>

May 12 16:04:59 server dockerd[12504]: time="2021-05-12T16:04:59.724605461-04:0>
May 12 16:04:59 server dockerd[12504]: time="2021-05-12T16:04:59.724671035-04:0>
May 12 16:04:59 server dockerd[12504]: time="2021-05-12T16:04:59.726331220-04:0>

Done!

bookmark_borderInstalling Fail2Ban on Rocky Linux 8

Hello,

In this week’s feature highlight, we look at How to Fail2Ban on Rocky Linux 8

Fail2Ban is an intrusion prevention framework written in the Python programming language. It works by reading SSH, ProFTP, Apache logs, etc. And uses iptables profiles to block brute-force attempts.

To install Fail2ban, The EPEL repository needs to be installed first.

yum install epel-release

Note: It will prompt for several permission Press “y” and “Enter” to continue.

Next, install fail2ban package.

yum install fail2ban

Note: This will prompt for several permissions, Press “y” and “Enter” to continue.

Set fail2ban to start on boot automatically,

systemctl enable fail2ban

Configuring local file settings.

Jail.conf contains a section which Configuration settings can be done for the fail2ban, we are not going edit this file because package upgrade can overwrite this file.

Jail.local contains same section where jail.conf file contains and it can override this values.

/etc/fail2ban/jail.d/ can override both jails.local and jails.conf files

First we begin with the jail.local file.

Open the file for editing,

nano /etc/fail2ban/jail.local

Add the following content,

[DEFAULT]
# Ban hosts for one hour:
bantime = 3600

# Override /etc/fail2ban/jail.d/00-firewalld.conf:
banaction = iptables-multiport

[sshd]
enabled = true

If server uses firewalld instead of iptables, simply comment the banaction line

Restarting the Fail2Ban service to load new settings.

systemctl restart fail2ban

To check status

fail2ban-client status

Output:

Status
|- Number of jail:      1
`- Jail list:   sshd

To view detailed information of sshd

fail2ban-client status sshd

Ouput:

[root@server ~]# fail2ban-client status sshd
Status for the jail: sshd
|- Filter
|  |- Currently failed: 5
|  |- Total failed:     238
|  `- Journal matches:  _SYSTEMD_UNIT=sshd.service + _COMM=sshd
`- Actions
   |- Currently banned: 19
   |- Total banned:     19
   `- Banned IP list:   221.131.165.56 183.89.70.240 211.200.178.178 218.92.0.207 221.181.185.143 221.181.185.220 189.207.242.90 120.246.124.254 51.254.84.249 103.20.34.169 218.22.36.135 1.179.185.50 171.245.229.51 106.55.240.205 212.64.60.50 58.240.52.43 209.141.60.60 171.225.250.69 221.181.185.151

Modify the content of the file /etc/fail2ban/jail.local

nano /etc/fail2ban/jail.local

Setting ban time

#ban time setting to 600sec
bantime = 600 

Setting conditions to ban a client

findtime = 600 
maxretry = 3

In this example, the client is blocked if he makes 3 unsuccessful login attempts with in 10 mins.

To check the details of banned IPs and number of login attempts,

fail2ban-client status sshd

Output:

[root@server ~]# fail2ban-client status sshd
Status for the jail: sshd
|- Filter
|  |- Currently failed: 5
|  |- Total failed:     262
|  `- Journal matches:  _SYSTEMD_UNIT=sshd.service + _COMM=sshd
`- Actions
   |- Currently banned: 21
   |- Total banned:     21
   `- Banned IP list:   221.131.165.56 183.89.70.240 211.200.178.178 218.92.0.207 221.181.185.143 221.181.185.220 189.207.242.90 120.246.124.254 51.254.84.249 1        03.20.34.169 218.22.36.135 1.179.185.50 171.245.229.51 106.55.240.205 212.64.60.        50 58.240.52.43 209.141.60.60 171.225.250.69 221.181.185.151 142.93.215.8 222.18        7.238.136

bookmark_borderInstalling WordPress on Rocky Linux 8

Hello,

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

Prerequisites:

WordPress requires LAMP stack installed and running

For detailed installation, refer to LAMP Stack on Rocky Linux 8

Creating the new database:

Log into MySQL with the following command,

mysql -u root -p

First, we’ll create a new database,

CREATE DATABASE wordpress;

Next, create a new MySQL user account that we will use to operate on WordPress’s new database, with username “admin”

CREATE USER `admin`@`localhost` IDENTIFIED BY '<Enter Strong Password here>';

Link the user and DB together by granting our user access to the database,

GRANT ALL ON wordpress.* TO `admin`@`localhost`;

Flush the privileges so that MySQL knows about the user permissions we just added,

FLUSH PRIVILEGES;

Exit out of the MySQL command prompt by typing,

exit

Output:

MariaDB [(none)]> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> CREATE USER `admin`@`localhost` IDENTIFIED BY '<Enetered Password>';
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> GRANT ALL ON wordpress.* TO `admin`@`localhost`;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]>

Download and extract WordPress:

Download the wordpress by using curl command and extract the downloaded file

curl https://wordpress.org/latest.tar.gz --output wordpress.tar.gz

tar xf wordpress.tar.gz

Copy the extracted WordPress directory into the /var/www/html directory:

cp -r wordpress /var/www/html

Change permissions and change file SELinux security context:

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

chcon -t httpd_sys_rw_content_t /var/www/html/wordpress -R

Navigate your browser:

http://server_IP/wordpress

Start WordPress Installer

Start WordPress installation by clicking on “Run the installation” button:

Provide the requested information:

Once the wordpress is installed login with your new user credentials:

Done!

bookmark_borderInstalling LEMP Stack on Rocky Linux 8

Hello,

In this week’s feature highlight, we look at How to Install LEMP Stack on Rocky Linux 8

LEMP is a combination of free, open source software. The acronym LEMP refers to the first letters of Linux (Operating system), Nginx Server, MySQL (database software), and PHP, PERL or Python, principal components to build a viable general purpose web server.

Install Nginx Web Server

First, we will start by installing the Nginx web server. To complete the installation, use the following command:

yum install nginx -y

Output:

[root@server ~]# yum install nginx -y
Last metadata expiration check: 3:33:16 ago on Thu 06 May 2021 11:33:45 AM EDT.
Dependencies resolved.
================================================================================
 Package                     Arch   Version                     Repo       Size
================================================================================
Installing:
 nginx                       x86_64 1:1.14.1-9.module+el8.3.0+121+6327f1ce
                                                                appstream 566 k
Installing dependencies:
 dejavu-fonts-common         noarch 2.35-6.el8                  baseos     73 k
 dejavu-sans-fonts           noarch 2.35-6.el8                  baseos    1.5 M
 fontconfig                  x86_64 2.13.1-3.el8                baseos    273 k

Once the installation is complete, enable Nginx (to start automatically upon system boot), start the web server and verify the status using the commands below.

systemctl start nginx

systemctl enable nginx

systemctl status nginx

Output:

[root@server ~]# systemctl enable nginx
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
[root@server ~]# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor prese>
   Active: active (running) since Thu 2021-05-06 15:08:01 EDT; 14s ago
 Main PID: 10636 (nginx)
    Tasks: 2 (limit: 4956)
   Memory: 3.9M
   CGroup: /system.slice/nginx.service
           ├─10636 nginx: master process /usr/sbin/nginx
           └─10637 nginx: worker process

Check Nginx version

nginx -v

Output:

[root@vps ~]# nginx -v
nginx version: nginx/1.14.1

To make your pages available to public, you will have to edit your firewall rules to allow HTTP requests on your web server by using the following commands.

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

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

firewall-cmd --reload

Output:

[root@server ~]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@server ~]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@server ~]# firewall-cmd --reload
success

Verify that the web server is running and accessible by accessing your server’s IP address.

From your browser,

http://IP_address
image

We need to make user nginx as the owner of web directory. By default it’s owned by the root user.

chown nginx:nginx /usr/share/nginx/html -R

Install MariaDB Server

MariaDB is a popular database server. The installation is simple and requires just a few steps as shown.

yum install mariadb-server mariadb -y

Output:

[root@server ~]# yum install mariadb-server mariadb -y
Last metadata expiration check: 3:36:48 ago on Thu 06 May 2021 11:33:45 AM EDT.
Dependencies resolved.
================================================================================
 Package             Arch   Version                             Repo       Size
================================================================================
Installing:
 mariadb             x86_64 3:10.3.28-1.module+el8.3.0+126+a7f7b5c5
                                                                appstream 6.0 M
 mariadb-server      x86_64 3:10.3.28-1.module+el8.3.0+126+a7f7b5c5
                                                                appstream  16 M
Installing dependencies:
 libaio              x86_64 0.3.112-1.el8                       baseos     31 k
 mariadb-common      x86_64 3:10.3.28-1.module+el8.3.0+126+a7f7b5c5

Once the installation is complete, enable MariaDB (to start automatically upon system boot), start the MariaDB and verify the status using the commands below.

systemctl start mariadb

systemctl enable mariadb

systemctl status mariadb

Output:

[root@server ~]# systemctl status mariadb
● mariadb.service - MariaDB 10.3 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor pre>
   Active: active (running) since Thu 2021-05-06 15:11:41 EDT; 16s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
 Main PID: 12068 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30 (limit: 4956)
   Memory: 79.7M
   CGroup: /system.slice/mariadb.service
           └─12068 /usr/libexec/mysqld --basedir=/usr

Finally, you will want to secure your MariaDB installation by issuing the following command.

mysql_secure_installation

Output:

[root@server ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!   

Once secured, you can connect to MySQL and review the existing databases on your database server by using the following command.

mysql -e "SHOW DATABASES;" -p

Output:

[root@server ~]# mysql -e "SHOW DATABASES;" -p
Enter password:
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+

Install PHP

To Install PHP-FPM by running the following command.

yum install php php-mysqlnd php-fpm php-opcache php-gd php-xml php-mbstring -y

Output:

[root@server ~]# yum install php php-mysqlnd php-fpm php-opcache php-gd php-xml php-mbstring -y
Last metadata expiration check: 3:40:09 ago on Thu 06 May 2021 11:33:45 AM EDT.
Dependencies resolved.
================================================================================
 Package           Arch   Version                               Repo       Size
================================================================================
Installing:
 php               x86_64 7.2.24-1.module+el8.3.0+200+280400f1  appstream 1.5 M
 php-fpm           x86_64 7.2.24-1.module+el8.3.0+200+280400f1  appstream 1.6 M
 php-gd            x86_64 7.2.24-1.module+el8.3.0+200+280400f1  appstream  83 k
 php-mbstring      x86_64 7.2.24-1.module+el8.3.0+200+280400f1  appstream 579 k
 php-mysqlnd       x86_64 7.2.24-1.module+el8.3.0+200+280400f1  appstream 189 k

Once the installation is complete, enable php-fpm (to start automatically upon system boot), start the php-fpm and verify the status using the commands below.

systemctl start php-fpm

systemctl enable php-fpm

systemctl status php-fpm

Output:

[root@server ~]# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor pre>
   Active: active (running) since Thu 2021-05-06 15:14:35 EDT; 12s ago
 Main PID: 12664 (php-fpm)
   Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/s>
    Tasks: 6 (limit: 4956)
   Memory: 25.8M
   CGroup: /system.slice/php-fpm.service
           ├─12664 php-fpm: master process (/etc/php-fpm.conf)
           ├─12665 php-fpm: pool www
           ├─12666 php-fpm: pool www
           ├─12667 php-fpm: pool www

By default, PHP-FPM runs as the apache user. Since we are using Nginx web server, we need to change following line.

vi /etc/php-fpm.d/www.conf

user = apache
group = apache

Change them to

user = nginx
group = nginx

Once changed, need to reload php-fpm

systemctl reload php-fpm

Test your PHP, by creating a simple info.php file with a phinfo() in it. The file should be placed in the directory root for your web server, which is /usr/share/nginx/html/info.php.

To create the file use:

echo "<?php phpinfo() ?>" > /usr/share/nginx/html/info.php

Restart the Nginx and PHP-FPM.

systemctl restart nginx php-fpm

Now again, access http://localhost/info.php or http://yourserver-ip-address/info.php. You should see a page similar to below one.

image

Done!

bookmark_borderInstalling LAMP Stack on Rocky Linux 8

Hello,

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

A LAMP stack is a group of open-source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP.

Install Apache Web Server

First, we will start by installing the Apache web server. To complete the installation, use the following command.

yum install httpd httpd-tools

Output:

[root@server ~]# yum install httpd httpd-tools
Last metadata expiration check: 2:04:33 ago on Thu 06 May 2021 11:33:45 AM EDT.
Dependencies resolved.
================================================================================
 Package           Arch   Version                               Repo       Size
================================================================================
Installing:
 httpd             x86_64 2.4.37-30.module+el8.3.0+124+cde66633 appstream 1.5 M
 httpd-tools       x86_64 2.4.37-30.module+el8.3.0+124+cde66633 appstream 103 k
Installing dependencies:
 apr               x86_64 1.6.3-11.el8                          appstream 124 k
 apr-util          x86_64 1.6.1-6.el8                           appstream 104 k
 httpd-filesystem  noarch 2.4.37-30.module+el8.3.0+124+cde66633 appstream  36 k

Once the installation is complete, enable Apache (to start automatically upon system boot), start the web server and verify the status using the commands below.

systemctl enable httpd

systemctl start httpd

systemctl status httpd

Output:

[root@server ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor prese>
   Active: active (running) since Thu 2021-05-06 13:39:18 EDT; 6s ago
     Docs: man:httpd.service(8)
 Main PID: 9517 (httpd)
   Status: "Started, listening on: port 80"
    Tasks: 213 (limit: 4956)
   Memory: 25.0M
   CGroup: /system.slice/httpd.service
           ├─9517 /usr/sbin/httpd -DFOREGROUND
           ├─9518 /usr/sbin/httpd -DFOREGROUND
           ├─9519 /usr/sbin/httpd -DFOREGROUND

To make your pages available to public, you will have to edit your firewall rules to allow HTTP and HTTPS requests on your web server by using the following commands.

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

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

firewall-cmd --reload

Output:

[root@server ~]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@server ~]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@server ~]# firewall-cmd --reload
success

Verify that the web server is running and accessible by accessing your server’s IP address.

echo "Hello there, Apache webserver is now running" > /var/www/html/index.html

And restart tht Web Server to reflect the changes made.

systemctl restart httpd

From your browser,

http://IP_address
image

Install PHP

To install PHP on your RHEL 8 use the command below.

yum install -y php-mysqlnd php-dom php-simplexml php-xml php-xmlreader php-curl php-exif php-ftp php-gd php-iconv  php-json php-mbstring php-posix php-sockets php-tokenizer

Now restart your web server so that Apache knows that it will be serving PHP requests as well.

systemctl restart httpd 

Test your PHP, by creating a simple info.php file with a phinfo() in it. The file should be placed in the directory root for your web server, which is /var/www/html.

To create the file use:

echo "<?php phpinfo() ?>" > /var/www/html/info.php

Now again, access http://localhost/info.php or http://yourserver-ip-address/info.php. You should see a page similar to below one.

image

Install MariaDB Server

MariaDB is a popular database server. The installation is simple and requires just a few steps as shown.

yum install mariadb-server mariadb

Output:

[root@server ~]# yum install mariadb-server mariadb
Last metadata expiration check: 2:23:42 ago on Thu 06 May 2021 11:33:45 AM EDT.
Dependencies resolved.
================================================================================
 Package                    Arch   Version                      Repo       Size
================================================================================
Installing:
 mariadb                    x86_64 3:10.3.28-1.module+el8.3.0+126+a7f7b5c5
                                                                appstream 6.0 M
 mariadb-server             x86_64 3:10.3.28-1.module+el8.3.0+126+a7f7b5c5
                                                                appstream  16 M
Installing dependencies:
 libaio                     x86_64 0.3.112-1.el8                baseos     31 k

Once the installation is complete, enable MariaDB (to start automatically upon system boot), start the MariaDB and verify the status using the commands below.

systemctl enable mariadb

systemctl start mariadb

systemctl status mariadb

Output:

[root@server ~]# systemctl status mariadb
● mariadb.service - MariaDB 10.3 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor pre>
   Active: active (running) since Thu 2021-05-06 13:59:14 EDT; 2s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 13127 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, s>
  Process: 12990 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service>
  Process: 12966 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, sta>
 Main PID: 13095 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 30 (limit: 4956)

Finally, you will want to secure your MariaDB installation by issuing the following command.

mysql_secure_installation

Output:

[root@server ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

Once secured, you can connect to MySQL and review the existing databases on your database server by using the following command.

mysql -e "SHOW DATABASES;" -p

Output:

[root@server ~]# mysql -e "SHOW DATABASES;" -p
Enter password:
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+

Done!

bookmark_borderUI improvements for our ControlPanel

Hey There,

We’re happy to announce a few UI improvements for our control panel when viewed via a Mobile and/or Tablet device.

With this CrownPanel update,  we’ve made some improvements on UI for the Mobile/Tab view, this update includes a number of improvements that will help you navigate and more smoothly.

Here are some of the snapshots of the Control panel,

Home page:

Manage Page:

As seen in the above screenshots, we can see some of the improvements made to the Home page and VPS manage page layout to prevent elements from overlapping each other, giving the page an overall much cleaner look.

We’ve received amazing feedback from our beta test users. We’re happy to release these improvements to all users today.

Let us know if you have any thoughts or feedback to make it better. Our support team is all ears for your feedback/suggestions!

Stay tuned for more updates!

Follow us on CrownCloud BlogTwitter, and Facebook for updates regarding current offers and other updates.