How to Install Joomla CMS on CentOS 8
Step 1 - Update your base system with the latest available packages.
dnf update -y
Step 2 Install Server
dnf install httpd mariadb-server php php-cli php-common php-spl php-hash php-ctype php-json php-mbstring php-zip php-gd php-curl php-mysqli php-xml unzip -y
start the Apache and MariaDB services and enable them to start after system reboot with the following command:
systemctl start httpd
systemctl start mariadb
systemctl enable httpd
systemctl enable mariadb
Step 3 – Configure the MariaDB Database
By default, MariaDB is not secured. You can secure it using the following script:
mysql_secure_installation
This script will set the MariaDB root password, remove anonymous users, disallow root login remotely, and remove the test database, as shown below:
Enter current password for root (enter for none): Just Press Enter
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
Once you are done, log in to the MariaDB shell with the following command:
mysql -u root -p
Provide your root password, then create a database and user for Joomla:
CREATE DATABASE joomladb;
GRANT ALL PRIVILEGES ON joomladb.* TO 'joomla'@'localhost' IDENTIFIED BY 'password';
Next, flush the privileges and exit from the MariaDB shell with the following command:
FLUSH PRIVILEGES;
EXIT;
Once the MariaDB is configured, you can proceed to the next step.
How to Install phpMyAdmin on CentOS 8
How to Install phpMyAdmin on CentOS 8
Step 1 Update your base system with the latest available packages.
# dnf update -y
Step 2 – Install Apache, MariaDB and PHP
Before starting, install Apache, MariaDB, PHP and other required PHP extensions with the following command:
dnf install httpd mariadb-server php php-cli php-json php-mbstring php-pdo php-pecl-zip php-mysqlnd -y
Step 3 – Set MariaDB Root Password
First, start the MariaDB service and enable it to start on boot time with the following command:
systemctl start mariadb
systemctl enable mariadb
Next, set the MySQL root password using the following script:
mysql_secure_installation
This script will set the MySQL root password, remove anonymous users, disallow root login remotely and remove the test database and access to it, as shown below:
Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
Step 4 – Install phpMyAdmin ver. 5.x.x
First, download the latest version of phpMyAdmin to the Apache web root directory using the following command:
# cd /var/www/html
wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.tar.gz
Once downloaded, unzip the downloaded file with the following command:
# tar xvf phpMyAdmin-5.0.2-all-languages.tar.gz
Next, rename the extracted directory to phpmyadmin as shown below:
# mv phpMyAdmin-5.0.2-all-languages phpmyadmin
Next, change the ownership of the phpmyadmin directory to the apache user:
# chown -R apache:apache /var/www/html/phpmyadmin
Next, rename the config.sample.inc.php file:
# cd /var/www/html/phpmyadmin
# mv /usr/share/phpMyAdmin/config.sample.inc.php /usr/share/phpMyAdmin/config.inc.php
Next, edit the file and define your secure password:
# nano /etc/httpd/conf.d/phpmyadmin.conf
Find the line below and update with your secure password, as shown below:
Step 5 – Configure Apache for phpMyAdmin
Next, create an Apache virtual host configuration file for phpMyAdmin:
nano /etc/httpd/conf.d/phpmyadmin.conf
Add the following lines:
Alias /phpmyadmin /var/www/html/phpmyadmin
<Directory /var/www/html/phpmyadmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require all granted
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
<Directory /var/www/html/phpmyadmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require all granted
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
Save and close the file. Then, start the Apache service and enable it to start after system reboot with the following command:
systemctl start httpd
systemctl enable httpd
Now, open your web browser and visit the URL http://your-server-address or IP/phpmyadmin. You should see the phpMyAdmin web interface in the following screen:
Change SSH Port on CentOS
Change SSH Port on CentOS 8
First, create a backup of sshd_config.
# cp/etc/ssh/sshd_config/etc/ssh/sshd_config_backup
Then open your ssh configuration to change it
# sudo nano /etc/ssh/sshd_config
This command will open the SSH (SSHD) server configuration.
We make the following change to the sshd_config file
# SSH port
Port 11111 # port that needs to be changed
We then update the IPTABLES firewall by introducing a new SSHD port.
If you have your firewall turned off, you can skip this step.
If you are using centos 6, you can run this command
For centOS 6
# iptables -I INPUT -p tcp --dport 11111 --syn -j ACCEPT
# service iptables save
# semanage port -a -t ssh_port_t -p tcp 11111
For centOS 7/8
# firewall-cmd --add-port 11111/tcp --permanent
# firewall-cmd --add-port 11111/tcp
The configuration will start working after restarting SSH Server (SSHD) services or after restarting the server.
# service sshd resrtart
or
# systemctl restart sshd
If you have trouble getting to SSHD, you need to configure SELinux policy since you changed port 22 to 11111.
Run this command.
# semanage port -a -t ssh_port_t -p tcp 11111
Then restart the server.
# reboot
Centos 8 install SSH service step by step
Centos 8 install SSH service step by step
Install the openssh package:
# dnf install openssh-server
Start the OpenSSH service by executing the following command:
# systemctl start sshd
Check the status of the sshd service.
# systemctl status sshd
Enable the SSH service to start after the reboot:
# systemctl enable sshd
Open the firewall rules to accept incoming traffic on SSH default port 22:
# firewall-cmd --zone=public --permanent --add-service=ssh
Connect to the SSH server with IP eg. 10.1.1.1 as the root user from a remote client machine:
$ ssh
Page 38 of 93