Install LAMP Server on Centos 7

Install LAMP Server on Centos 7

There are few steps to install LAMP server on Centos 7.

First of you need to add EPEL Repository of mysql

 rpm -iUvh

Add the EPEL Repository for phpmyadmin

 rpm -iUvh
 yum -y update

Step 1-:
To install LAMP on Centos server needs to install the below packages.

yum install -y httpd php phpmyadmin mysql-server

Step 2-:
To allow the phpmyadmin in apache 2.4 add the line

Require all granted

vi /etc/httpd/conf.d/phpMyAdmin.conf

<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8

<IfModule mod_authz_core.c>
# Apache 2.4
Require ip
Require ip ::1
Require all granted

To add the apache application on start up

systemctl enable httpd

Restart the apache server

 systemctl restart httpd

Step 3-:
Set the mysql root password.

$ mysql
 mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root');
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> quit

Step 4-:
Allow port 80 and 443 in iptables public zone

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent

Then remember to reload the firewall for changes to take effect.

firewall-cmd --reload

Step 5-:
LAMP server is ready to use.
Visit to phpmyadmin
To check the phpinfo

 $ echo " " > /var/www/html/index.php



http://<server ip >


Post a comment