Skip to content

Centos 7 Quickfixes

Two years ago (2014), I wrote the article “CentOS 6.5 Configuration Tips” to document the steps I take in building a CentOS 6.5 server. Through the years, it has saved me a lot of time in rolling out custom CentOS builds for client requirements. Truth be told, the article is a life saver. It allows me to build, customize, deploy, and deliver servers consistently all-the-time every time. Likewise, my coworkers benefit from the article because it provides a simple guide on how to install frugal CentOS 6.5 builds. Of course, at the end of the day,  when they give me a properly configured server build, I benefit.

However, like everything else in the IT, things change quite quickly. Usually, there are minute changes here and there which may be annoying at times but are totally tolerable. But there are times, such as the case at hand, where the annoyances turn into complete nuisances.

To cut the story short, CentOS 7 is a substantial departure from CentOS 6.5. This departure makes the 2014 article on “CentOS Configuration Tips” partially obsolete. Thus, a new guide is warranted.

CentOS Versions -- Wikipedia
CentOS Versions — Wikipedia

Who is this guide for

This guide is for seasoned server administrators looking for a quick reference or Linux curious noobs trying to get a feel of a frugal CentOS implementation.

CentOS 7 Quickfixes

  1. Update and Upgrade CentOS 7
  2. Install USB Device Utilities (lsusb)
  3. Install Network Utilities (ifconfig)
  4. Install WGET
  5. Install GNU GCC Development Environment
  6. Install GCC GCC-C++ NCURSES-DEVEL
  7. Install Apache HTTPD Server
    1. Remove welcome.conf
    2. Allow HTTPD port 80 in firewall
  8. Install PHP
  9. Install MariaDB
    1. Securing the Database
    2. Tune MariaDB

 

xxx

1 Update and Upgrade CentOS 7

[root@samgalope ~]yum update && yum upgrade
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
No packages marked for update
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
No packages marked for update

^Back to top

2 Install USB Device Utilities (lsusb)

As opposed to prior version, lsusb and other USB utilities are not installed by default in CentOS 7. The first step is to determine what package lsusb is part of.

[root@samgalope ~]yum whatprovides lsusb
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
usbutils-007-5.el7.x86_64 : Linux USB utilities
Repo : base
Matched from:
Filename : /usr/bin/lsusb
usbutils-007-5.el7.x86_64 : Linux USB utilities
Repo : @base
Matched from:
Filename : /usr/bin/lsusb

Then install it.
[root@samgalope ~]# yum install usbutils
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
Resolving Dependencies
--> Running transaction check
---> Package usbutils.x86_64 0:007-5.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================
Package Arch Version Repository Size
======================================================================================
Installing:
usbutils x86_64 007-5.el7 base 79 k
-
Transaction Summary
======================================================================================
Install 1 Package
Total download size: 79 k
Installed size: 183 k
Is this ok [y/d/N]: y
Downloading packages:
usbutils-007-5.el7.x86_64.rpm | 79 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : usbutils-007-5.el7.x86_64 1/1
Verifying : usbutils-007-5.el7.x86_64 1/1
Installed:
usbutils.x86_64 0:007-5.el7
Complete!

Test:
[root@samalope ~]# lsusb
Bus 008 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

^Back to top

3 Install Network Utilities (ifconfig)

[root@samgalope ~]# yum whatprovides ifconfig
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo : @base
Matched from:
Filename : /usr/sbin/ifconfig

Install it:
[root@samgalope ~]# yum install net-tools
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
net-tools x86_64 2.0-0.17.20131004git.el7 base 304 k
.
Transaction Summary
================================================================================
Install 1 Package
.
Total download size: 304 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.17.20131004Vgit.el7.x86_64.rpm | 304 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
Verifying : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
Installed:
net-tools.x86_64 0:2.0-0.17.20131004git.el7
Complete!

Test:
[root@samgalope ~]# ifconfig
ens5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.4 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::224:81ff:fe37:5e11 prefixlen 64 scopeid 0x20 ether 00:24:81:37:5e:11 txqueuelen 1000 (Ethernet)
RX packets 104025 bytes 139320146 (132.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 74776 bytes 6399942 (6.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 17
.
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
RX packets 108 bytes 10606 (10.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 108 bytes 10606 (10.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

^Back to top

4 Install Wget

Wget is one of the most useful unix commands ever made. It makes downloading data from the Internet a breeze. However in CentOS 7, it is not installed by default.
[root@samgalope ~]# yum install wget
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-10.el7_0.1 will be installed
--> Finished Dependency Resolution
.
Dependencies Resolved
==================================================================================
Package Arch Version Repository Size
==================================================================================
Installing:
wget x86_64 1.14-10.el7_0.1 base 545 k
.
Transaction Summary
==================================================================================
Install 1 Package
.
Total download size: 545 k
Installed size: 2.0 M
Is this ok [y/d/N]: y
Downloading packages:
wget-1.14-10.el7_0.1.x86_64.rpm | 545 kB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : wget-1.14-10.el7_0.1.x86_64 1/1
Verifying : wget-1.14-10.el7_0.1.x86_64 1/1
Installed:
wget.x86_64 0:1.14-10.el7_0.1
Complete!

5 Installing Development Tools

Development tools comprise of compilers and a gamut of system configuration helpers necessary to compile source code. For some reason, this is also not enabled as default in CentOS 7. This downloads and installs about thirty applications.
[root@samgalope ~]# yum groupinstall "Development Tools"
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates| 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
---> Package automake.noarch 0:1.13.4-3.el7 will be installed
---> Package bison.x86_64 0:2.7-4.el7 will be installed
---> Package byacc.x86_64 0:1.9.20130304-3.el7 will be installed
---> Package cscope.x86_64 0:15.8-7.el7 will be installed
---> Package ctags.x86_64 0:5.8-13.el7 will be installed
---> Package diffstat.x86_64 0:1.57-4.el7 will be installed
---> Package doxygen.x86_64 1:1.8.5-3.el7 will be installed
---> Package elfutils.x86_64 0:0.163-3.el7 will be installed
---> Package flex.x86_64 0:2.5.37-3.el7 will be installed
---> Package gcc.x86_64 0:4.8.5-4.el7 will be installed
---> Package gcc-c++.x86_64 0:4.8.5-4.el7 will be installed
---> Package gcc-gfortran.x86_64 0:4.8.5-4.el7 will be installed
--> Processing Dependency: libquadmath-devel = 4.8.5-4.el7 for package: gcc-gfortran-4.8.5-4.el7.x86_64
---> Package git.x86_64 0:1.8.3.1-6.el7_2.1 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-6.el7_2.1 for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-6.el7_2.1.x86_64
---> Package indent.x86_64 0:2.2.11-13.el7 will be installed
---> Package intltool.noarch 0:0.50.2-6.el7 will be installed
--> Processing Dependency: gettext-devel for package: intltool-0.50.2-6.el7.noarch
---> Package libtool.x86_64 0:2.4.2-21.el7_2 will be installed
---> Package patch.x86_64 0:2.7.1-8.el7 will be installed
---> Package patchutils.x86_64 0:0.3.3-4.el7 will be installed
---> Package rcs.x86_64 0:5.9.0-5.el7 will be installed
---> Package redhat-rpm-config.noarch 0:9.1.0-68.el7.centos will be installed
---> Package rpm-build.x86_64 0:4.11.3-17.el7 will be installed
---> Package rpm-sign.x86_64 0:4.11.3-17.el7 will be installed
---> Package subversion.x86_64 0:1.7.14-10.el7 will be installed
---> Package swig.x86_64 0:2.0.10-4.el7 will be installed
---> Package systemtap.x86_64 0:2.8-10.el7 will be installed
--> Processing Dependency: systemtap-devel = 2.8-10.el7 for package: systemtap-2.8-10.el7.x86_64
--> Running transaction check
---> Package gettext-devel.x86_64 0:0.18.2.1-4.el7 will be installed
---> Package libquadmath-devel.x86_64 0:4.8.5-4.el7 will be installed
---> Package perl-Git.noarch 0:1.8.3.1-6.el7_2.1 will be installed
---> Package systemtap-devel.x86_64 0:2.8-10.el7 will be installed
--> Finished Dependency Resolution
.
Dependencies Resolved
.
===================================================================================
Package Arch Version Repository Size
====================================================================================
Installing for group install "Development Tools":
autoconf noarch 2.69-11.el7 base 701 k
automake noarch 1.13.4-3.el7 base 679 k
bison x86_64 2.7-4.el7 base 578 k
byacc x86_64 1.9.20130304-3.el7 base 65 k
cscope x86_64 15.8-7.el7 base 203 k
ctags x86_64 5.8-13.el7 base 155 k
diffstat x86_64 1.57-4.el7 base 35 k
doxygen x86_64 1:1.8.5-3.el7 base 3.6 M
elfutils x86_64 0.163-3.el7 base 268 k
flex x86_64 2.5.37-3.el7 base 292 k
gcc x86_64 4.8.5-4.el7 base 16 M
gcc-c++ x86_64 4.8.5-4.el7 base 7.2 M
gcc-gfortran x86_64 4.8.5-4.el7 base 6.6 M
git x86_64 1.8.3.1-6.el7_2.1 updates 4.4 M
indent x86_64 2.2.11-13.el7 base 150 k
intltool noarch 0.50.2-6.el7 base 59 k
libtool x86_64 2.4.2-21.el7_2 updates 588 k
patch x86_64 2.7.1-8.el7 base 110 k
patchutils x86_64 0.3.3-4.el7 base 104 k
rcs x86_64 5.9.0-5.el7 base 230 k
redhat-rpm-config noarch 9.1.0-68.el7.centos base 77 k
rpm-build x86_64 4.11.3-17.el7 base 143 k
rpm-sign x86_64 4.11.3-17.el7 base 44 k
subversion x86_64 1.7.14-10.el7 base 1.0 M
swig x86_64 2.0.10-4.el7 base 1.3 M
systemtap x86_64 2.8-10.el7 base 25 k
Installing for dependencies:
gettext-devel x86_64 0.18.2.1-4.el7 base 315 k
libquadmath-devel x86_64 4.8.5-4.el7 base 46 k
perl-Git noarch 1.8.3.1-6.el7_2.1 updates 53 k
systemtap-devel x86_64 2.8-10.el7 base 1.6 M
.
Transaction Summary
===================================================================================
Install 26 Packages (+4 Dependent packages)
.
Total download size: 47 M
Installed size: 136 M
Is this ok [y/d/N]: y
Downloading packages:
(1/30): autoconf-2.69-11.el7.noarch.rpm | 701 kB 00:00:06
(2/30): byacc-1.9.20130304-3.el7.x86_64.rpm | 65 kB 00:00:06
(3/30): diffstat-1.57-4.el7.x86_64.rpm | 35 kB 00:00:00
(4/30): automake-1.13.4-3.el7.noarch.rpm | 679 kB 00:00:08
(5/30): ctags-5.8-13.el7.x86_64.rpm | 155 kB 00:00:04
(6/30): bison-2.7-4.el7.x86_64.rpm | 578 kB 00:00:12
(7/30): elfutils-0.163-3.el7.x86_64.rpm | 268 kB 00:00:12
(8/30): cscope-15.8-7.el7.x86_64.rpm | 203 kB 00:00:20
(9/30): flex-2.5.37-3.el7.x86_64.rpm | 292 kB 00:00:10
(10/30): gettext-devel-0.18.2.1-4.el7.x86_64.rpm | 315 kB 00:00:15
(11/30): doxygen-1.8.5-3.el7.x86_64.rpm | 3.6 MB 00:01:46
(12/30): indent-2.2.11-13.el7.x86_64.rpm | 150 kB 00:00:02
(13/30): intltool-0.50.2-6.el7.noarch.rpm | 59 kB 00:00:01
(14/30): libquadmath-devel-4.8.5-4.el7.x86_64.rpm| 46 kB 00:00:01
(15/30): gcc-gfortran-4.8.5-4.el7.x86_64.rpm | 6.6 MB 00:01:43
(16/30): patch-2.7.1-8.el7.x86_64.rpm | 110 kB 00:00:09
(17/30): patchutils-0.3.3-4.el7.x86_64.rpm | 104 kB 00:00:01
(18/30): libtool-2.4.2-21.el7_2.x86_64.rpm | 588 kB 00:00:17
(19/30): perl-Git-1.8.3.1-6.el7_2.1.noarch.rpm | 53 kB 00:00:01
(20/30): rcs-5.9.0-5.el7.x86_64.rpm | 230 kB 00:00:02
(21/30): rpm-build-4.11.3-17.el7.x86_64.rpm | 143 kB 00:00:01
(22/30): rpm-sign-4.11.3-17.el7.x86_64.rpm | 44 kB 00:00:00
(23/30): redhat-rpm-config-9.1.0-68.el7.centos.noarch.rpm | 77 kB 00:00:07
(24/30): subversion-1.7.14-10.el7.x86_64.rpm | 1.0 MB 00:00:22
(25/30): systemtap-2.8-10.el7.x86_64.rpm | 25 kB 00:00:01
(26/30): git-1.8.3.1-6.el7_2.1.x86_64.rpm | 4.4 MB 00:02:08
(27/30): swig-2.0.10-4.el7.x86_64.rpm | 1.3 MB 00:00:35
(28/30): systemtap-devel-2.8-10.el7.x86_64.rpm | 1.6 MB 00:00:43
(29/30): gcc-c++-4.8.5-4.el7.x86_64.rpm | 7.2 MB 00:03:16
(30/30): gcc-4.8.5-4.el7.x86_64.rpm | 16 MB 00:03:48
-----------------------------------------------------------------------------
Total 198 kB/s | 47 MB 00:04:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : gcc-4.8.5-4.el7.x86_64 1/30
Installing : autoconf-2.69-11.el7.noarch 2/30
Installing : automake-1.13.4-3.el7.noarch 3/30
Installing : patch-2.7.1-8.el7.x86_64 4/30
Installing : systemtap-devel-2.8-10.el7.x86_64 5/30
Installing : libquadmath-devel-4.8.5-4.el7.x86_64 6/30
Installing : git-1.8.3.1-6.el7_2.1.x86_64 7/30
Installing : perl-Git-1.8.3.1-6.el7_2.1.noarch 8/30
Installing : gettext-devel-0.18.2.1-4.el7.x86_64 9/30
Installing : redhat-rpm-config-9.1.0-68.el7.centos.noarch 10/30
Installing : elfutils-0.163-3.el7.x86_64 11/30
Installing : rpm-build-4.11.3-17.el7.x86_64 12/30
Installing : intltool-0.50.2-6.el7.noarch 13/30
Installing : gcc-gfortran-4.8.5-4.el7.x86_64 14/30
Installing : systemtap-2.8-10.el7.x86_64 15/30
Installing : libtool-2.4.2-21.el7_2.x86_64 16/30
Installing : gcc-c++-4.8.5-4.el7.x86_64 17/30
Installing : swig-2.0.10-4.el7.x86_64 18/30
Installing : rpm-sign-4.11.3-17.el7.x86_64 19/30
Installing : diffstat-1.57-4.el7.x86_64 20/30
Installing : patchutils-0.3.3-4.el7.x86_64 21/30
Installing : flex-2.5.37-3.el7.x86_64 22/30
Installing : indent-2.2.11-13.el7.x86_64 23/30
Installing : rcs-5.9.0-5.el7.x86_64 24/30
Installing : cscope-15.8-7.el7.x86_64 25/30
Installing : subversion-1.7.14-10.el7.x86_64 26/30
Installing : 1:doxygen-1.8.5-3.el7.x86_64 27/30
Installing : byacc-1.9.20130304-3.el7.x86_64 28/30
Installing : bison-2.7-4.el7.x86_64 29/30
Installing : ctags-5.8-13.el7.x86_64 30/30
Verifying : ctags-5.8-13.el7.x86_64 1/30
Verifying : gcc-4.8.5-4.el7.x86_64 2/30
Verifying : bison-2.7-4.el7.x86_64 3/30
Verifying : byacc-1.9.20130304-3.el7.x86_64 4/30
Verifying : gcc-c++-4.8.5-4.el7.x86_64 5/30
Verifying : elfutils-0.163-3.el7.x86_64 6/30
Verifying : automake-1.13.4-3.el7.noarch 7/30
Verifying : 1:doxygen-1.8.5-3.el7.x86_64 8/30
Verifying : subversion-1.7.14-10.el7.x86_64 9/30
Verifying : cscope-15.8-7.el7.x86_64 10/30
Verifying : systemtap-devel-2.8-10.el7.x86_64 11/30
Verifying : patch-2.7.1-8.el7.x86_64 12/30
Verifying : rcs-5.9.0-5.el7.x86_64 13/30
Verifying : libquadmath-devel-4.8.5-4.el7.x86_64 14/30
Verifying : perl-Git-1.8.3.1-6.el7_2.1.noarch 15/30
Verifying : indent-2.2.11-13.el7.x86_64 16/30
Verifying : rpm-build-4.11.3-17.el7.x86_64 17/30
Verifying : flex-2.5.37-3.el7.x86_64 18/30
Verifying : systemtap-2.8-10.el7.x86_64 19/30
Verifying : gettext-devel-0.18.2.1-4.el7.x86_64 20/30
Verifying : patchutils-0.3.3-4.el7.x86_64 21/30
Verifying : autoconf-2.69-11.el7.noarch 22/30
Verifying : intltool-0.50.2-6.el7.noarch 23/30
Verifying : redhat-rpm-config-9.1.0-68.el7.centos.noarch 24/30
Verifying : gcc-gfortran-4.8.5-4.el7.x86_64 25/30
Verifying : libtool-2.4.2-21.el7_2.x86_64 26/30
Verifying : diffstat-1.57-4.el7.x86_64 27/30
Verifying : rpm-sign-4.11.3-17.el7.x86_64 28/30
Verifying : swig-2.0.10-4.el7.x86_64 29/30
Verifying : git-1.8.3.1-6.el7_2.1.x86_64 30/30
.
Dependency Installed:
gettext-devel.x86_64 0:0.18.2.1-4.el7 libquadmath-devel.x86_64 0:4.8.5-4.el7
perl-Git.noarch 0:1.8.3.1-6.el7_2.1 systemtap-devel.x86_64 0:2.8-10.el7

^Back to top

6 Install GCC GCC-C++ NCURSES-DEVEL

In case the group install omitted a few packages, install gcc, gcc-c++, and ncurses-devel manually.
[root@lappy ~]# yum install gcc gcc-c++ ncurses-devel
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-4.el7 will be installed
---> Package gcc-c++.x86_64 0:4.8.5-4.el7 will be installed
---> Package ncurses-devel.x86_64 0:5.9-13.20130511.el7 will be installed
--> Finished Dependency Resolution
.
Dependencies Resolved
.
=======================================================================================
Package Arch Version Repository Size
=======================================================================================
Installing:
gcc x86_64 4.8.5-4.el7 base 16 M
gcc-c++ x86_64 4.8.5-4.el7 base 7.2 M
ncurses-devel x86_64 5.9-13.20130511.el7 base 713 k
.
Transaction Summary
=========================================================================================
Install 3 Packages
.
Total download size: 24 M
Installed size: 56 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): ncurses-devel-5.9-13.20130511.el7.x86_64.rpm | 713 kB 00:00:07
(2/3): gcc-c++-4.8.5-4.el7.x86_64.rpm | 7.2 MB 00:01:29
(3/3): gcc-4.8.5-4.el7.x86_64.rpm | 16 MB 00:02:26
-----------------------------------------------------------------------------------------
Total 168 kB/s | 24 MB 00:02:26
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : gcc-4.8.5-4.el7.x86_64 1/3
Installing : gcc-c++-4.8.5-4.el7.x86_64 2/3
Installing : ncurses-devel-5.9-13.20130511.el7.x86_64 3/3
Verifying : ncurses-devel-5.9-13.20130511.el7.x86_64 1/3
Verifying : gcc-c++-4.8.5-4.el7.x86_64 2/3
Verifying : gcc-4.8.5-4.el7.x86_64 3/3
.
Installed:
gcc.x86_64 0:4.8.5-4.el7 gcc-c++.x86_64 0:4.8.5-4.el7
ncurses-devel.x86_64 0:5.9-13.20130511.el7
.
Complete!

^Back to top

7 Install Apache HTTPD Web Server

[root@lappy ~]# yum install httpd
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-40.el7.centos.4 will be installed
--> Finished Dependency Resolution
.
Dependencies Resolved
.
====================================================================================
Package Arch Version Repository Size
====================================================================================
Installing:
httpd x86_64 2.4.6-40.el7.centos.4 updates 2.7 M
.
Transaction Summary
=====================================================================================
Install 1 Package
.
Total download size: 2.7 M
Installed size: 9.4 M
Is this ok [y/d/N]: y
Downloading packages:
httpd-2.4.6-40.el7.centos.4.x86_64.rpm | 2.7 MB 00:00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : httpd-2.4.6-40.el7.centos.4.x86_64 1/1
Verifying : httpd-2.4.6-40.el7.centos.4.x86_64 1/1
Installed:
httpd.x86_64 0:2.4.6-40.el7.centos.4
Complete!

Additional configuration:

Welcome.conf

This removes the welcome page provided in default Apache installations. Some guides suggest that welcome.conf should be deleted but I disagree. It may be useful in the future. So, I merely rename it. It is best to remove it out right.
[root@samgalope ~]#
mv /etc/httpd.conf/conf.d/welcome.conf /etc/httpd.conf/conf.d/notsowelcome.conf

Firewall exception

CentOS blocks port 80 by default. Of course, HTTPD serves no purpose if port 80 is blocked. Thus, this “new” command makes the exception.
[root@samgalope ~]# firewall-cmd --add-service=http --permanent
success

[root@samgalope ~]# firewall-cmd --reload
success

^Back to top

8 Install PHP

[root@samgalope conf.d]# yum install php
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.4.16-36.3.el7_2 will be installed
--> Finished Dependency Resolution
.
Dependencies Resolved
.
=====================================================================
Package Arch Version Repository Size
=====================================================================
Installing:
php x86_64 5.4.16-36.3.el7_2 updates 1.4 M
.
Transaction Summary
======================================================================
Install 1 Package
.
Total download size: 1.4 M
Installed size: 4.4 M
Is this ok [y/d/N]: y
Downloading packages:
php-5.4.16-36.3.el7_2.x86_64.rpm | 1.4 MB 00:00:17
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : php-5.4.16-36.3.el7_2.x86_64 1/1
Verifying : php-5.4.16-36.3.el7_2.x86_64 1/1
.
Installed:
php.x86_64 0:5.4.16-36.3.el7_2
.
Complete!

Restart the HTTPD


[root@samgalope]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service

^Back to top

Install MySQL / MariaDB

[root@samgalope]# yum install mariadb-server
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.pregi.net
* extras: mirror.pregi.net
* updates: mirror.pregi.net
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.50-1.el7_2 will be installed
--> Finished Dependency Resolution
.
Dependencies Resolved
.
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
mariadb-server x86_64 1:5.5.50-1.el7_2 updates 11 M
.
Transaction Summary
=============================================================================
Install 1 Package
.
Total download size: 11 M
Installed size: 56 M
Is this ok [y/d/N]: y
Downloading packages:
mariadb-server-5.5.50-1.el7_2.x86_64.rpm | 11 MB 00:00:52
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:mariadb-server-5.5.50-1.el7_2.x86_64 1/1
Verifying : 1:mariadb-server-5.5.50-1.el7_2.x86_64 1/1
.
Installed:
mariadb-server.x86_64 1:5.5.50-1.el7_2
.
Complete!

Secure the Database Server

[root@lappy conf.d]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found
.
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
.
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
.
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: *********
Re-enter new password: *********
Password updated successfully!
Reloading privilege tables..
... Success!
.
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
.
Remove anonymous users? [Y/n] n
... skipping.
.
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
.
Disallow root login remotely? [Y/n] n
... skipping.
.
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
.
Reload privilege tables now? [Y/n] y
... Success!
.
Cleaning up...
.
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
.
Thanks for using MariaDB!</code>

For additional materials, here’s a few helpful websites:

  1. http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installation/
  2. http://elearning.wsldp.com/pcmagazine/centos-install-htop/
  3. https://www.linode.com/docs/databases/mariadb/how-to-install-mariadb-on-centos-7

Be First to Comment

Leave a Reply

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