Web Server , Database & Scripting Language are the building blocks of web based software like WordPress, Drupal, Joomla and OpenCart. In Fedora linux Apache is the Web Server, Mariadb is the database server & php is the Scripting Language.
In this tutorial we install Apache, Mariadb & php on Fedora 23 workstation ( Desktop).
Install Apache ( Web Server )
dnf command is the advanced version of yum and is a Package Manager for RPM based Linux Distribution. So in Fedora 23 we will installing all the packages using dnf command.
[root@fedora23 ~]# dnf install httpd
Use below command to check Apache rpm Version
[root@fedora23 ~]# rpm -q httpd httpd-2.4.16-1.fc23.x86_64 [root@fedora23 ~]#
Start the Apache Service
[root@fedora23 ~]# systemctl start httpd [root@fedora23 ~]# systemctl enable httpd Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. [root@fedora23 ~]#
Open default 80 port for Apache in case firewall is enable.
[root@fedora23 ~]# firewall-cmd --permanent --add-service=http success [root@fedora23 ~]# firewall-cmd --reload success [root@fedora23 ~]#
Verify the Installation of Apache :
Use “ip add show” command to verify the ip address of your machine.
Open the browser type IP Address or hostname of your machine.
Install MariaDB ( Database Server )
[root@fedora23 ~]# dnf install mariadb-server
Start the mariadb service and enable it across the reboot.
[root@fedora23 ~]# systemctl start mariadb [root@fedora23 ~]# systemctl enable mariadb Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service. [root@fedora23 ~]#
Configure Initial settings of database server and root password using “mysql_secure_installation”
[root@fedora23 ~]# mysql_secure_installation
Install php ( Scripting Language )
Use below dnf command to install php and other important php modules.
[root@fedora23 ~]# dnf install php php-mysql php-pdo php-gd php-mbstring
To test the php installation , create a php file (fedora23.php) in /var/www/html
[root@fedora23 ~]# vi /var/www/html/fedora23.php <?php phpinfo() ?>
Restart the Apache Service
[root@fedora23 ~]# systemctl restart httpd [root@fedora23 ~]#
Now Access the Fedora23.php file in your browser :
http://<IP_Address_Your_Machine>/fedora23.php
As we can see php info page , it means php is installed successfully.