{"id":1401,"date":"2018-11-17T21:50:14","date_gmt":"2018-11-17T18:50:14","guid":{"rendered":"http:\/\/kifarunix.com\/?p=1401"},"modified":"2024-03-11T21:35:29","modified_gmt":"2024-03-11T18:35:29","slug":"how-to-install-lemp-nginxmariadbphp7-2-stack-on-fedora-28-fedora-29","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-install-lemp-nginxmariadbphp7-2-stack-on-fedora-28-fedora-29\/","title":{"rendered":"How to Install LEMP (Nginx,MariaDB,PHP7.2) Stack on Fedora 28 \/ Fedora 29"},"content":{"rendered":"\n
In this guide, we are going to learn how to install LEMP (Nginx,MariaDB,PHP7.2) Stack on Fedora 28 \/ Fedora 29. As you already know, LEMP Stack is an acronym that stands for L<\/strong>inux Operating system, which is of course the system on which your are going to do installations on, N<\/strong>ginx, commonly pronounced as Engine-x, M<\/strong>ariaDB\/M<\/strong>ySQL, which is a relational database management systems and P<\/strong>HP which is a server-side dynamic web scripting language.<\/p>\n\n\n\n Before you can proceed, it is a good ideas to update your system.<\/p>\n\n\n\n Once your update is done, install Nginx. Nginx is available on Fedora default repositories and can just be install using the package manager as shown below.<\/p>\n\n\n\n Once the installation is done, start and enable Nginx to run on system reboot.<\/p>\n\n\n\n You can now test your web server after installation. If firewall is running, you need to allow Nginx through it.<\/p>\n\n\n\n Navigate to your browser and enter your server’s hostname or IP address in order to test if Nginx is actually working. If all is well, you should be able to see such a page as shown below;<\/p>\n\n\n\n MariaDB is an opensource relational database management system that has been forked from the famous MySQL. It is available by default on Fedora repositories and can be installed as shown below.<\/p>\n\n\n\n Start and enable MariaDB to run on system boot.<\/p>\n\n\n\n MariaDB comes bundled with a security script call To verify that all is well, try to login to MariaDB as a root user.<\/p>\n\n\n\n Well, seems we are in business! Proceed to Install PHP.<\/p>\n\n\n\n Well, we require PHP in order to generate dynamic web content. Installation of PHP and other requires PHP extensions can be done as shown below;<\/p>\n\n\n\n Your LEMP stack setup is now done. Before you can conclude that all is well, create a PHP test page to verify that it is actually working.<\/p>\n\n\n\n Create a test page, Navigate to the browser and enter your PHP info page URL in the format shown below. Note that this will take you to a web page where you can see various PHP information. See the screenshot below.<\/p>\n\n\n\n Congratulations, your LEMP stack is now setup and is fully functioning. You might have to remove the info.php file to avoid exposing your server information to the internet crooks.<\/p>\n\n\n\n You can also check our previous similar articles by following the links below.<\/p>\n\n\n\n How to Install LAMP Stack (Apache,MariaDB, PHP 7.2) on Ubuntu 18.04 LTS<\/a><\/p>\n\n\n\nInstall LEMP Stack on Fedora 28 \/ Fedora 29<\/h2>\n\n\n\n
Install Nginx Web Server on Fedora<\/h3>\n\n\n\n
dnf update<\/code><\/pre>\n\n\n\n
dnf install nginx -y<\/code><\/pre>\n\n\n\n
systemctl start nginx\nsystemctl enable nginx<\/code><\/pre>\n\n\n\n
firewall-cmd --add-service=http --permanent\nfirewall-cmd --reload<\/code><\/pre>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Installing MariaDB on Fedora<\/h3>\n\n\n\n
sudo dnf install mariadb-server -y<\/code><\/pre>\n\n\n\n
systemctl start mariadb\nsystemctl enable mariadb<\/code><\/pre>\n\n\n\n
mysql_secure_installation<\/code> that is used to perform basic database security by setting up root password, removing anonymous users, test databases and disabling database remote login. Press Enter to accept yes<\/strong>.<\/p>\n\n\n\n
mysql_secure_installation<\/code><\/pre>\n\n\n\n
\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\n SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!\n\nIn order to log into MariaDB to secure it, we'll need the current\npassword for the root user. If you've just installed MariaDB, and\nyou haven't set the root password yet, the password will be blank,\nso you should just press enter here.\n\nEnter current password for root (enter for none): ENTER<\/strong>\nOK, successfully used password, moving on...\n\nSetting the root password ensures that nobody can log into the MariaDB\nroot user without the proper authorisation.\n\nSet root password? [Y\/n] y<\/strong>\nNew password: STRONGPASSWORD<\/strong>\nRe-enter new password: STRONGPASSWORD<\/strong>\nPassword updated successfully!\nReloading privilege tables..\n ... Success!\n\n\nBy default, a MariaDB installation has an anonymous user, allowing anyone\nto log into MariaDB without having to have a user account created for\nthem. This is intended only for testing, and to make the installation\ngo a bit smoother. You should remove them before moving into a\nproduction environment.\n\nRemove anonymous users? [Y\/n] y<\/strong>\n ... Success!\n\nNormally, root should only be allowed to connect from 'localhost'. This\nensures that someone cannot guess at the root password from the network.\n\nDisallow root login remotely? [Y\/n] y<\/strong>\n ... Success!\n\nBy default, MariaDB comes with a database named 'test' that anyone can\naccess. This is also intended only for testing, and should be removed\nbefore moving into a production environment.\n\nRemove test database and access to it? [Y\/n] y<\/strong>\n - Dropping test database...\n ... Success!\n - Removing privileges on test database...\n ... Success!\n\nReloading the privilege tables will ensure that all changes made so far\nwill take effect immediately.\n\nReload privilege tables now? [Y\/n] y<\/strong>\n ... Success!\n\nCleaning up...\n\nAll done! If you've completed all of the above steps, your MariaDB\ninstallation should now be secure.\n\nThanks for using MariaDB!\n<\/code><\/pre>\n\n\n\n
mysql -u root -p<\/strong><\/code><\/pre>\n\n\n\n
\nEnter password:\nWelcome to the MariaDB monitor. Commands end with ; or \\g.<\/strong>\nYour MariaDB connection id is 16<\/strong>\nServer version: 10.3.10-MariaDB MariaDB Server<\/strong>\n\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.<\/strong>\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.<\/strong>\n\nMariaDB [(none)]>\n<\/code><\/pre>\n\n\n\n
Installing PHP on Fedora<\/h3>\n\n\n\n
sudo dnf install php php-fpm php-mysqlnd php-gd php-mcrypt php-mbstring<\/code><\/pre>\n\n\n\n
\/usr\/share\/nginx\/html\/info.php<\/code> with the following contents.<\/p>\n\n\n\n
<?php phpinfo(); ?><\/code><\/pre>\n\n\n\n
http:\/\/<Server's IP>\/info.php<\/code><\/pre>\n\n\n
<\/a><\/figure><\/div>\n\n\n
rm \/usr\/share\/nginx\/html\/info.php<\/code><\/pre>\n\n\n\n