CATEGORIES

TAGS

SSL

PostgreSQL

cPanel

email

Error

WHM

Linux

Bash

Debian

Ubuntu

How to install LAMP on Red Hat system

22nd August
mySQL
How to install LAMP on Red Hat system

If you use Debian Linux system and want to install LAMP check this. LAMP is a stake of software components and includes Apache web server, MySQL (MariaDB) database, and PHP programming language. Let’s install the LAMP on your Red Hat system. At first, let’s install Apache web server. In Red Hat system you can install something via “yum” for CentOS and “dnf” for Fedora. “yum” and “dnf” are package managers in Red Hat system. But package manager “yum” you can use in Fedora to.

Step 1


To install Apache use this command:
Copied!

sudo yum install httpd



Once you have installed apache it will start. To start Apache server use this command:

Copied!

systemctl start httpd



You can enable Apache automatically starting at boot time with this command:

Copied!

systemctl enable httpd



INFO: it is a good idea to check the status of the server after starting Apache with this command:



Copied!

systemctl status httpd



Step 2


Apache is ready. The next is installing MySQL (MariaDB). You can install MySQL via this command:

Copied!

sudo yum install mariadb-server mariadb



After processing you should start the server with this command:

Copied!

sudo systemctl start mariadb



Now you have installed MySQL (MariaDB) in your Debian 9. But we recommend you to run the following command to set a new root password, “remove anonymous users”, “disallow root login remotely”, “remove test database and access to it”, “reload privilege tables”:

Copied!

sudo mysql_secure_installation



TIP: After running this command the system will ask you “Enter current password for root (enter for none):” here just press enter because you still haven’t any password set. Then you will see “Set root password? [Y/n]” type “y” to set password. In the next line there will be “New password:” line here you should create some password for your server and “Re-enter new password” in the next line. Now you have a new password. On the other questions that you can see above you can answer yes “y”.



Step 3


Now let’s start installing PHP. It is simple - just run this command:

Copied!

yum install php php-mysql



INFO: “php -mysql” for including support package for the MySQL.



After installation PHP it is a good idea to restart the server. To do this use the following command:

Copied!

systemctl restart httpd.service



By using this command you will install PHP 5 but if you want to install PHP 7 check this: That is all!!!


SUBSCRIBE by email and never miss a post!