Build a CentOS 7 Server

Configured with Apache, PHP, Perl, Ruby,
MariaDB, phpMyAdmin, NTP, and PureFTP

by Edward Kimmel

Introduction and Domain Registrar Preparation

Build a
CentOS 7 Server
Part 1 Page 1
  • Edward Kimmel
    January 26, 2020

  CentOS (/ˈsɛntɒs/, from Community Enterprise Operating System) is a Linux™ distribution that provides a free, community-supported computing platform functionally compatible with its upstream source, Red Hat Enterprise Linux (RHEL). (Read More on CentOS... Wikipedia, the free encyclopedia)

Tutorial Introduction

  A complete Do-It-Yourself tutorial on how to build your own Internet Hosting Server using the latest version of CentOS 7 (CentOS 7.7 at the time of this writing). This tutorial will take you step by step from start to finish resulting in a fully functional commercial grade web hosting Linux™ server. All of the steps of this tutorial were tested several times to confirm they are 100% correct and up to date as of January 26th, 2020. There are a lot of tutorials out there, but I could not find a single one that resulted in a fully operational hosting server, something failed and a lot was always left out. My tutorial is a result of me researching each step of the process and working out all of the bugs to obtain my goal.

  I am not including any type of server controlling interface such as ISPConfig or CentOS Web Panel to help you set up and configure your web hosting server. I personally started with this approach to learn the basics of setting up a hosting web server but I soon discovered that they all had you disable SELinux server security to get their hosting service control panel to work. This was something that bothered me because in today's age of hackers out there in the untamed world wide web, I don't feel safe. It's just not average hackers by the way, it could actually be a foreign or domestic government agency hacking your server now a days and I personally want all of the protection I can get for my web hosting server.

  Sooner or later you will need to learn how to troubleshoot and fix things on your server. This tutorial shows you how to get things running by doing to yourself the old fashion way from a command line creating all of the files manually. I will also include as much information I can to help you learn about running a Linux™ hosting server.

  This undertaking is also being done using just a simple residential broadband service provided by my local telephone company. I am lucky to live in a rural area far from the big cities and have fiber broadband to the house. I can honestly say my upload speed is as fast as my download speed so hosting my own personally owned web domains from my own CentOS 7 server possible. This has also eliminated the monthly cost of paying for a server that I can't personally touch.

  Also keep in mind this information is provided as is with no guarantee what so ever. I will assume no responsibility for anyone who uses the information in this article legally and/or uses this information illegally in a mischievous manor. Just because it seems to work on my Internet service provider doesn't mean that it will work on yours, nor does it mean it is legal to use on your Internet service provider. You will use my provided information at your own risk. In simple words, don't try to blame me if you happen to get yourself in some sort of trouble or fined or obtain any type of additional charges or fees. Please be responsible and use this information for the en betterment of the human race.

Domain Registrar Preparation

  It is very important to setup DNS records, specifically "MX" records in your domain registrar's control panel. Login to your domain registrar's control panel and change your DNS settings to add these following "MX" records entries.

  Where "MX" is the type of record, "MX" stands for Mail Exchangers. Next is the value for host, you can either enter your domain name or you can also use "@" which represents the value of the zone name which is same as your domain name. Next you will have to choose the destination, you will need to enter the hostname or FQDN (Fully Qualified Domain Name) of your mail server.

  The next value is the priority. The lowest number is priority. For example 0 will have the highest priority and 20 will have a lower priority. Priority is used because we can add multiple "MX" records for a single domain, mail is forwarded to the server having highest priority. If the server having highest priority is not available then mail will be forwarded to the server having second highest priority. Next is TTL or Time to Live, it should be set to 3600.

  It is very important that you also setup an A record for your hostname of the mail server FQDN. Again select the type as "A" record, host should be the hostname you are using in your FQDN, for example in this case we have used the hostname as "mail.laurelhosting.com", hence our host will be "mail". Next, at destination, enter the IP address of your server. "A" records does not have priority option hence, you will only need to provide TTL.

  Once you have configured your DNS settings, you will need to wait some time so that DNS gets propagated. It usually takes around two hours these days but sometimes it can take up to 72 hours.

  Until your DNS gets propagated, you can continue with the installation. Typical "MX", "A&qiot; and "CNAME" records will look something close to this:

    Type   Host    Destination             Priority   TTL
    MX     @       mail.laurelhosting.com  10         3600
    A      mail    192.168.1.240           10         3600
    A      @       192.168.1.240           10         3600
    A      www     192.168.1.240           10         3600
    CNAME  www     192.168.1.240           10         3600

  We will not be setting up a mail server at this time in this tutorial. After many attempts of trying to set up my own local mail server for my personal hosting CentOS 7 server I have failed. Primarily I feel it is because I am using the IP for my home Internet Service Provider (ISP) and I am not paying for a commercial static IP package. I feel another reason is due to all of the idiots out there who found it was very easy to set up their own mail server and abused their privilege of simple. Now mail servers of major commercial hosting companies want a fully qualified and certified server to talk to because of those idiots who sent tons of SPAM and Internet garbage. I haven't given up the idea, I just haven't found anyone yet who has posted a working solution to show and teach me what I need to know. I am still learning! I will configure my CentOS 7 hosting server to use an email address from my Ionos.com (formally 1and1.com) hosting package for now.

Total Page Views to Date = 116