Install Linux Httpd MariaDB PHP on CentOS 6

Install Httpd, open terminal and type in this command:

#yum install -y httpd
Loaded plugins: fastestmirror
Setting up Install Process
....................................................................
Installed:
httpd.x86_64 0:2.2.15-54.el6.centos

Complete!

Start httpd and set always run on reboot with following command

#service httpd start
Starting httpd: [ OK ]
#chkconfig httpd on

Install MariaDB from a repository using yum, before install make sure CentOS packages is up-to-date

#yum -y update

Then add the MariaDB repository

#vi /etc/yum.repos.d/MariaDB.repo

Insert this custom MariaDB 10.1 Stable YUM repository for CentOS 6 (64 Bit).

# MariaDB 10.1 CentOS repository list - created 2016-07-03 19:01 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

MariaDB 10.1 Stable YUM repository for CentOS 6

# MariaDB 10.1 CentOS repository list - created 2016-12-03 16:57 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

For complete custom MariaDB repository with linux system version please visit
https://downloads.mariadb.org/mariadb/repositories/

Install MariaDB

#yum install MariaDB-server MariaDB-client -y

Start MariaDB and set to start on every boot.

#service mysql start
#chkconfig mysql on

Secure MariaDB, secure your MariaDB installation with the following checklist
Set (Change) root password
Remove anonymous users
Disallow root login remotely.
Remove test database and access to it.
Reload privilege tables.
Run the secure installation command.

#mysql_secure_installation

Enter current password for root (enter for none):
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: ENTER YOUR PASSWORD
Re-enter new password: REPEAT YOUR PASSWORD
Password updated successfully!
Reloading privilege tables..
... Success!

Remove anonymous users? [Y/n] y
... Success!

Disallow root login remotely? [Y/n] y
... Success!

Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reload privilege tables now? [Y/n] y
... Success!

Cleaning up...

Thanks for using MariaDB!

Restart MariaDB.

#service mysql restart

Install PHP by open terminal and type in this command:

#yum install php php-mysql php-gd -y

** Install PHP-GD library if necessary, PHP GD is PHP Modules to support manipulating images like imagejpeg, imagedestroy, etc

#service httpd restart

Leave a Reply

Your email address will not be published. Required fields are marked *