Installing vsftpd on CentOS 8
Installing vsftpd on CentOS 8
# dnf install -y vsftpd
Take backup of existing vsftpd.conf file.
# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.org
Edit vsftpd configuration file.
# vi /etc/vsftpd/vsftpd.conf
Open FTP port 21 on the system firewall to allow access to FTP services from external systems.
# firewall-cmd --zone=public --permanent --add-port=20-21/tcp
# firewall-cmd --permanent --add-port=30000-31000/tcp
or # firewall-cmd --add-service=ftp --permanent
# firewall-cmd --reload
Set the following parameters with these corresponding values
anonymous_enable=NO # line 12: make sure value is [NO] (no anonymous) local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES listen=NO # line 115: change (if listening IPv4 only) if listning IPv4 and IPv6 both, specify [NO] listen_ipv6=YES pam_service_name=vsftpd
use_localtime=YES
Configure User List in Secure FTP Server:
Users that are allowed/deny to use FTP service are listed in a user_list file.
Default user_list file is located at /etc/vsftpd/user_list, we can add or remove FTP users in this file.
By default, all the users in the user_list are denied to access FTP service.
We have to explicitly allow users in user_list by setting following directives in vsftpd.conf file.
userlist_enable=YES # enable vsftpd to load usernames
userlist_deny=NO # allow access to users in userlist
Enable Chroot Jail for Secure FTP Server on CentOS 8:
To restrict FTP users in a chrooted environment, add following two directives in vsftpd.conf file.
chroot_local_user=YES # Create chrooted environment for users
allow_writeable_chroot=YES # Allow write permission to user on chroot jail directory
For security, you can also enable TLS encryption
Create a CentOS 8 User to access Secure FTP Service:
# useradd new_user
# passwd new_user
Add this user to allowed user_list.
# echo ahmer >> /etc/vsftpd/user_list
How to Stop and Disable Firewalld on CentOS 8
How to Stop and Disable Firewalld on CentOS 8
FirewallD is a complete firewall solution that dynamically manages the trust level of network connections and interfaces. Firewalld gives you full control over what traffic is allowed or disallowed to and from the system.
Step 1
Check the Firewall Status
# firewall-cmd --state
or
# systemctl status firewalld
Step 2
Disable Firewall
You can temporarily stop the FirewallD service with the following command:
# systemctl stop firewalld
Disable the FirewallD service to start automatically on system boot:
# systemctl disable firewalld
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:




