How To Install Joomla On Centos 8
Install LAMP Server on CentOS 8.
sudo dnf update
Install Apache Web Server.
sudo dnf install httpd httpd-tools
Output:
[root@vps ~]# sudo dnf install httpd httpd-tools
Last metadata expiration check: 0:00:16 ago on Fri 20 Mar 2020 12:17:03 PM EDT.
Dependencies resolved.
================================================================================
Package Arch Version Repo Size
================================================================================
Installing:
httpd x86_64 2.4.37-16.module_el8.1.0+256+ae790463 AppStream 1.7 M
httpd-tools x86_64 2.4.37-16.module_el8.1.0+256+ae790463 AppStream 103 k
Installing dependencies:
apr x86_64 1.6.3-9.el8 AppStream 125 k
apr-util x86_64 1.6.1-6.el8 AppStream 105 k
centos-logos-httpd
noarch 80.5-2.el8 AppStream 24 k
Once the installation is complete, enable Apache to auto-start at system boot time using the command below.
sudo systemctl enable httpd
sudo systemctl start httpd
sudo systemctl status httpd
Output:
[root@vps ~]# sudo systemctl enable httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@vps ~]# sudo systemctl start httpd
[root@vps ~]# sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: di>
Active: active (running) since Fri 2020-03-20 12:21:33 EDT; 3min 12s ago
Docs: man:httpd.service(8)
Main PID: 5499 (httpd)
Status: "Running, listening on: port 80"
To check PHP version.
httpd -v
Output:
n [root@vps ~]# httpd -v Server version: Apache/2.4.37 (centos)
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
Install MariaDB on CentOS 8
dnf install mariadb-server mariadb -y
Output:
[root@vps ~]# dnf install mariadb-server mariadb -y
Last metadata expiration check: 0:40:47 ago on Fri 20 Mar 2020 12:17:03 PM EDT.
Dependencies resolved.
=====================================================================================
Package Arch Version Repo Size
=====================================================================================
Installing:
mariadb x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 AppStream 6.1 M
mariadb-server x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 AppStream 16 M
Installing dependencies:
mariadb-common x86_64 3:10.3.17-1.module_el8.1.0+257+48736ea6 AppStream 62 k
mariadb-connector-c x86_64 3.0.7-1.el8 AppStream 148 k
mariadb-connector-c-config
start and enable MariaDB on startup, run the command.
systemctl start mariadb
systemctl enable mariadb
You can verify the status of MariaDB.
systemctl status mariadb
Output:
[root@vps ~]# systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
[root@vps ~]# systemctl status mariadb
● mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: >
Active: active (running) since Fri 2020-03-20 13:00:05 EDT; 59s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
we need to secure our MariaDB database engine by running.
Output:
[root@vps ~]# 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] n
... skipping.
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
Install PHP 7 on CentOS 8
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
Output:
[root@vps ~]# sudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
Last metadata expiration check: 0:05:51 ago on Fri 20 Mar 2020 01:11:21 PM EDT.
remi-release-8.rpm 52 kB/s | 23 kB 00:00
Dependencies resolved.
=====================================================================================
Package Architecture Version Repository Size
=====================================================================================
Installing:
yum-utils noarch 4.0.8-3.el8 BaseOS 64 k
remi-release noarch 8.1-2.el8.remi @commandline 23 k
After the successful installation of yum-utils and Remi-packages, search for the PHP modules which are available for download by running the command.
sudo dnf module list php
Output:
[root@vps ~]# sudo dnf module list php
Remi's Modular repository for Enterprise Linux 201 kB/s | 539 kB 00:02
Safe Remi's RPM repository for Enterprise Linux 271 kB/s | 1.4 MB 00:05
Last metadata expiration check: 0:00:01 ago on Fri 20 Mar 2020 05:34:55 PM EDT.
CentOS-8 - AppStream
Name Stream Profiles Summary
php 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common, 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
The output indicates that the currently installed version of PHP is PHP 7.2. To install the newer release, PHP 7.4, reset the PHP modules.
sudo dnf module reset php
Having reset the PHP modules, enable the PHP 7.4 module by running.
sudo dnf module enable php:remi-7.4
Output:
[root@vps ~]# sudo dnf module enable php:remi-7.4
Last metadata expiration check: 0:02:03 ago on Fri 20 Mar 2020 05:34:55 PM EDT.
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Enabling module streams:
php remi-7.4
Transaction Summary
================================================================================
Is this ok [y/N]: y
Finally, install PHP, PHP-FPM (FastCGI Process Manager) and associated PHP modules using the command.
sudo dnf install php php-opcache php-gd php-curl php-mysqlnd
Output:
[root@vps ~]# sudo dnf install php php-opcache php-gd php-curl php-mysqlnd
Last metadata expiration check: 0:02:47 ago on Fri 20 Mar 2020 01:18:51 PM EDT.
Dependencies resolved.
=====================================================================================
Package Arch Version Repo Size
=====================================================================================
Installing:
php x86_64 7.2.11-2.module_el8.1.0+209+03b9a8ff AppStream 1.5 M
php-common x86_64 7.2.11-2.module_el8.1.0+209+03b9a8ff AppStream 655 k
php-gd x86_64 7.2.11-2.module_el8.1.0+209+03b9a8ff AppStream 84 k
php-mysqlnd x86_64 7.2.11-2.module_el8.1.0+209+03b9a8ff AppStream 190 k
php-opcache x86_64 7.2.11-2.module_el8.1.0+209+03b9a8ff AppStream 230 k
Installing dependencies:
gd x86_64 2.2.5-6.el8 AppStream 144 k
jbigkit-libs x86_64 2.1-14.el8 AppStream 55 k
To verify the version installed to run.
php -v
Output:
[root@vps ~]# php -v
PHP 7.4.4 (cli) (built: Mar 17 2020 10:40:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies
Perfect! We now have PHP 7.4 installed. Equally important, we need to start and enable PHP-FPM on boot-up.
sudo systemctl start php-fpm
sudo systemctl enable php-fpm
To check its status execute the command.
sudo systemctl status php-fpm
Output:
[root@vps ~]# sudo 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 Fri 2020-03-20 17:38:06 EDT; 15s ago
Main PID: 9587 (php-fpm)
Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/s>
Tasks: 6 (limit: 5068)
Memory: 23.9M
To instruct SELinux to allow Apache to execute the PHP code via PHP-FPM run.
setsebool -P httpd_execmem 1
Finally, restart Apache web server for PHP to work with Apache web server.
sudo systemctl restart httpd
Then head out to your browser, and type the URL below. Remember to replace the server IP address with your server’s actual IP address.
http://server-ip-address/info.php