Install LAMP,Stack on Fedora 28/29
Install LAMP,In our previous article, we protected how to set up LEMP (Linux, Nginx,MySQL/MariaDB, PHP) Stack on Fedora 28/29. Well, right here we are again on but every other guide on how to deploy LAMP (Linux, Apache, MySQL, PHP) Stack on Fedora 28/29.
Update your machine package repositories
dnf update -y
Install LAMP,Install Apache Web server
Apache is to be had on default Fedora repositories. Thus run the command beiow to install it.
dnf install httpd -y
Once the installation is carried out, allow Apache via firewall in case firewall is running in your device.
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --reload
Start and enable Apache to run on system start.
systemctl start httpd
systemctl enable httpd
You can verify that Apache is prepared to server your web content through navigation to the broswer and getting into your server IP address or the hostname. You ought to be able to see the default Fedora web page.
Now that appears nicely, continue to install MySQL database server.
Installing MySQL
Run the command below to install MySQL. Note that this can install MariaDB through default.
dnf install mysql mysql-server
In case you need to put in MySQL itself, you may want to get the reliable repositories from here.
Start and permit MySQL to run on device begin up.
systemctl enable mariadb
systemctl start mariadb
Once the installation is executed, run MySQL safety script as proven underneath to set the root password, eliminate the take a look at databases, eliminate anonymous customers and disable faraway login.
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): ENTER
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] y
New password: STRONGPASSWORD
Re-enter new password: STRONGPASSWORD
Password updated successfully!
Reloading privilege tables..
... Success!
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!
To confirm that each one is properly, try to login to MariaDB as a root user.
mysql -u root -p
Enter password: STRONGPASSWORD
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 16
Server version: 10.3.10-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
Installing PHP
Well, we require PHP that allows you to generate dynamic internet content. Installation of PHP and other calls for PHP extensions may be achieved as shown underneath;
sudo dnf install php php-fpm php-mysqlnd php-gd php-mcrypt php-mbstring
You can set up any PHP extensions relying to your needs.
Before you could finish that each one is properly, create a PHP take a look at page to verify that it’s far without a doubt running.
Create a check page, /var/www/html/data.Personal home page with the subsequent contents.
<?php phpinfo(); ?>
Navigate to the browser and input your PHP information page URL in the layout shown beneath. Note that this can take you to an internet web page in which you may see numerous PHP facts. See the screenshot underneath.
http://<Server's IP>/info.php
Congratulations, your LAMP stack is now setup and is completely functioning. You might have to take away the data.Hypertext Preprocessor document to avoid exposing your server facts to the internet crooks.
rm /var/www/html/info.php