INTRODUCTION

What is Lamp

Lamp is open source Linux base web development plate forum. The stands for Linux, Apache, MariaDB, and PHP that uses Linux as a operating system, Apache as web server, MariaDB as a database server and PHP as the object-oriented scripting language.

What is Apache

Apache is a freely available and world most popular Web server. Apache web server written in C Programming languages. It is also called httpd. Apache was developed in 1995 by Robert McCool but today new development and maintenance is provided by the Apache Software Foundation. Apache web server runs on almost 60{1c918b003a0fec779e46518dd4d8df22f3dc554de918030f5a1a0cfd93cb28be} plus websites across all the domains.

`

What is Mariadb

MariaDB An enhanced, drop-in replacement for MySQL developed by original authors of MySQL Project and fully compatible with MySQL having more features and better performance enhancement. In January 2008, Sun Microsystems bought MySQL for $1 billion after that bought by Oracle and which is no longer open source. The original developers of MySQL forked it and created MariaDB in 2009.

Why should I use MariaDB?

As you know MySQL is one of the world’s most popular open source relational database management system based on SQL (Structured Query Language). I have already mention above that in January 2008, Sun Microsystems bought MySQL for $1 billion after that MySQL bought by Oracle and which is no longer open source. As time passed, MariaDB replaced MySQL in many places

Who are using MariaDB?

There are number of distributions and large number of website moving it all to MariaDB. Internet king Google swaps out MySQL, moves to MariaDB and some other most popular website names are as follows which have been move MariaDB:

  • Google
  • Fedora
  • OLX
  • Nimbuzz
  • SlashGear
  • ArchLinux
  • Redhat Enterprise Linux (from RHEL7)
  • Slackware
  • Mageia
  • Slackware
  • TurboLinux
  • The Chakra Project
  • Gentoo
  • GNU/Linux KDu

What is PHP?

PHP (Hypertext Preprocessor) is one the world most widely-used open source server side scripting language that is used for web development. As of January 2013, PHP was installed on more than 240 million websites. PHP was developed in 1995 Rasmus Lerdorf.

SOLUTION

Step 1: Install Apache Server with Basic Configurations

First install Apache httpd service binary package using the following yum command.

#  yum install httpd

When httpd installation finished then uses the following commands to Start the httpd service on a CentOS/RHEL 7

#  sudo systemctl start httpd.service

Next step to make sure the httpd service start automatically at the boot time, then enter following command to start httpd service at boot time.

# sudo systemctl enable httpd.service

Open your web browser and type your server IP Address using HTTP protocol on URL

http://localhost/ or http://server-ip-address/

Step 2: Install PHP on a CentOS/RHEL v7.0

Before installing PHP5 dynamic language on centos/rhel v7.0. if you want a full list of available PHP modules and extensions then using the following command.

# yum search php

After run above command there are long list on your screen php module and extension but it is depend on your requirement what type of applications you want to use on centos server but for a basic MariaDB support in PHP and PhpMyAdmin you need to install the following modules.

# yum install php php-mysql php-pdo php-gd php-mbstring

You must restart the httpd (Apache) service:

# sudo systemctl restart httpd.service

if you want to see a full information list on PHP from your browser then first create a info.php file using the following command.

# echo “<?php phpinfo(); ?>” > /var/www/html/info.php

Restart httpd service:

# systemctl restart httpd

Open your web browser and type url http://server_IP/info.php address.

Step 3: Install and Configure MariaDB Database

I have already mentions in this tutorial there are number of distributions and large number of website moving it all to MariaDB. Red Hat Enterprise Linux/CentOS 7.0 and also in one them which switched from MySQL to MariaDB for its default database management system. To install MariaDB database use the following command. Internet king Google swaps out MySQL, moves to MariaDB Red Hat Enterprise Linux/CentOS 7.0.

# yum install mariadb-server mariadb

After MariaDB package is installed then next step that to start mariadb use following command

# systemctl start mariadb

To make sure the mariadb service start automatically at the boot time for purpose use following command

# sudo systemctl enable mariadb.service

Security is most important every database as know all records store in database. So next step is that how to Secure MariaDB database server use followings commands

# mysql_secure_installation

To test database functionality login to MariaDB using its root account and exit using quit statement.

mysql -u root -p

MariaDB > SHOW VARIABLES;

MariaDB > quit

Step 4: Install PhpMyAdmin

Before starting phpmyadmin installation, You must setup Extra Packages for Enterprise Linux (EPEL). First, we’ll install the EPEL repository using the following command.

# rpm -iUvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Update repositories by issuing below command

# yum -y update

Now step install phpmyadmin package using following with commands.

# yum install phpmyadmin

# rpm -ivh epel-release-7-5.noarch.rpm

After installation, Open /etc/httpd/conf.d/phpMyAdmin.conf file, Use a # and commenting the following lines.

# vi /etc/httpd/conf.d/phpMyAdmin.conf
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1

Now restart Apache Web service following command

# systemctl restart  httpd

After restart you can Verify that phpMyAdmin is working by visiting PhpMyAdmin on your browser to the URL address http://server_IP/phpmyadmin/.

Similar Posts