Before installing lamp, it is recommended to update the System package first
$ sudo DNF update
First step: Install the Apache Web server
1. Install Apache in Fedora 23 and you can run the following command:
$ sudo DNF install httpd
2. After the installation is complete, we set the Apache to start automatically when the system starts, and then we will start to verify the status of Apache. Run the following series of commands:
$ sudo systemctl enable Httpd.service
$ sudo systemctl start httpd
$ sudo systemctl status httpd
3. Run the Web server over HTTP and HTTPS and add the following rules to the Fedora Firewall:
$ sudo firewall-cmd--permanent--add-service=http
$ sudo firewall-cmd--permanent--add-service=https
4. Now to verify
$ IP A | grep inet//Get system IP Address
Open the browser at address input:/HTTP/Your IP address.
Note: The default Apache directory/var/www/html/
Step Two: Install the MARIADB server
5. Install mariadb in Fedora 23 and run the following command:
$ sudo DNF install Mariadb-server
6. After the installation is complete, we set the MARIADB to start automatically when the system starts, and then we will start verifying the status of the mariadb. Run the following series of commands:
# sudo systemctl enable mariadb
# sudo systemctl start mariadb
# sudo systemctl status mariadb
7. Several settings need to be adjusted to ensure the installation of your mariadb. To change this setting, we recommend that you run the following command:
# sudo mysql_secure_installation
Here's what you need to do:
- Ask for the root password of MySQL and leave it blank. There is no default password.
- Then be asked to enter a new mariadb root password, be sure to enter a strong password.
- Prompts you later whether to delete the anonymous user prompt for mariadb. This user is not, select "Y".
- Next, you need to disable root remote access to the database and select "Y". You can create a separate user for each database so that you can access the database you want.
- You will then be asked if you want to delete the "test" database that was created in the installation mariadb, this database is not required, so you can delete it and select "Y".
- Finally, select whether to reload the table and select "Y".
Step Three: Install PHP
8. Install PHP in Fedora 23 and you will need to run the following command:
$ sudo DNF install PHP Php-common
9. Next you need to install the PHP module to run the Php/mysql application, using the following command
$ sudo DNF install php-mysql php-pdo PHP-GD php-mbstring
10. Once the installation is complete, restart Apache to start applying PHP:
$ sudo systemctl restart httpd
11. Let's test and create the info.php file in/var/www/html, you can use the command:
$ cd/var/www/html
$ nano info.php
Enter the following code:
<?php
Phpinfo ()
?>
Save the file, go back to the browser, dial in http://Your IP address/info.php, and now you should be able to see the PHP information page.
Installing lamp (Linux, Apache, mariadb and PHP) on Fedora Server and workstation