Run the following set of commands to install Asterisk and FreePBX from source fast and efficient. 100% tested. The installation assumes you will be using a now-standard SIP trunk, considering the decease of ISDN, so will not go into details of configuring either DAHDI or other types of trunks.

sed -i 's/enforcing/permissive/g' /etc/selinux/config
Disable application of SELinux policy, run-time and permanent
yum install -y epel-release dmidecode gcc-c++ ncurses-devel libxml2-devel make wget openssl-devel newt-devel kernel-devel sqlite-devel libuuid-devel gtk2-devel jansson-devel binutils-devel git lynx tftp-server unixODBC mysql-connector-odbc mariadb-server mariadb httpd ncurses-devel sendmail sendmail-cf sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git crontabs cronie cronie-anacron wget vim uuid-devel sqlite-devel net-tools gnutls-devel python-devel texinfo libuuid-devel
Install the necessary packages to prepare compilation of Asterisk and FreePBX

3. Get source code of Asterisk:

cd /usr/src
git clone -b 16 asterisk-16
Clone a necessary Asterisk branch for compilation, in this case branch 16
cd /usr/src/asterisk-16
./configure --libdir=/usr/lib64 --with-jansson-bundled
make menuselect
Proceed to installing prerequisites, configuration of the installation

It is very important to enable a deprecated Asterisk app_macro in menuselect, a menu that you will see after make menuselect, if you are planning to use FreePBX. Here is a screenshot:

make && make install
make samples
chown asterisk. /var/run/asterisk
chown asterisk. -R /etc/asterisk
chown asterisk. -R /var/{lib,log,spool}/asterisk
chown asterisk. -R /var/www/
systemctl enable asterisk
Compile Asterisk, install it, make sample configuration files for the initial startup, adjust ownership enable autostart

Now we are ready to proceed to FreePBX installation

rpm -Uvh
rpm -Uvh
Install PHP 5.6 repositories
yum remove php*
yum install php56w php56w-pdo php56w-mysql php56w-mbstring php56w-pear php56w-process php56w-xml php56w-opcache php56w-ldap php56w-intl php56w-soap
Install PHP 5.6w
curl -sL | bash -yum install -y nodejs
Install NodeJS
systemctl enable mariadb.service
systemctl start mariadb
Enable MariaDB

When asked for a root password, just press Enter.

systemctl enable httpd.service
systemctl start httpd.service
Enable and start Apache
pear install Console_Getopt
Install PEAR requirements

Tweak Apache configuration:

sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.inised -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf
sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf
systemctl restart httpd.service
Adjusting settings for FreePBX
cd /usr/src
tar xvfz freepbx-14.0-latest.tgz
rm -f freepbx-14.0-latest.tgz
cd freepbx
./start_asterisk start
./install -n
Download and install FreePBX

Now take a note of admin credentials you get from FreePBX and start configuring your newly set up system.