Preparing steps for LAMP Installation

  • Apache install on Centos 7
  • MYSQL(MariaDB) install on Centos 7
  • PHP install on Centos 7

Apache install on Centos 7

  • Check OS version

# cat /etc/*release

  • Install apache

# yum install httpd httpd-devel

  • Start Service

# systemctl start httpd
# systemctl status httpd

  • Test URL

Browse for http://ip-address from web client system and same system

  • Add firewall rules

# Firewall-cmd –add-port=80/tcp –permanent
# Firewall-cmd –add-port=80/udp –permanent

MYSQL(MariaDB) install on Centos 7

  • Install MYSQL(MariaDB)

# yum install mariadb-server mariadb
# systemctl start mariadb

  • Make you MYSQL secure

# mysql_secure_installation
# systemctl restart mariadb

Connect to your MYSQL and set remote access to Remote IP

# mysql -u root -p
Enter password:
mysql>GRANT ALL ON . to root@’ip-addr’ IDENTIFIED BY ‘root’;
mysql>FLUSH PRIVILEGES; mysql>exit

PHP install on Centos 7

  • Install PHP

# yum install php php-mysql

  • Create test PHP file and restart Apache

# vi /var/www/html/info.php

<?php
phpinfo();
?>

# systemctl restart httpd

Verify config changes in Apache

  • Change 1: New file “php.conf” in /etc/httpd/conf.d/
  • Change 2: New file “10-php.conf” in /etc/httpd/conf.modules.d/
  • Change 3: New file “libphp5.so” in /etc/httpd/modules
Amardeep Dubey
Latest posts by Amardeep Dubey (see all)