You must have MariaDB running for FreePBX to operate normally. It must start automatically, and be running continuously.
systemctl enablemariadb.service
systemctl start mariadb
Now that our MariaDB database is running, we want to run a simple security script that will remove some dangerous defaults and lock down access to our database system a little bit
mysql_secure_installation
The prompt will ask you for your current root password. Since you just installed MySQL, you most likely won’t have one, so leave it blank by pressing enter. Then the prompt will ask you if you want to set a root password. Do not set a root password. We secure the database automatically, as part of the install script. Apart from that, you can choose yes for the rest. This will remove some sample users and databases, disable remote root logins, and load these new rules so that MySQL immediately respects the changes we have made.
Enable and Start Apache
FreePBX uses the Apache web server, so this must be started and running.
systemctl enablehttpd.service
systemctl start httpd.service
Install Dependencies for Google Voice (if required)
If you don’t have any physical PSTN hardware attached to this machine, you don’t need to install DAHDI (For example, a T1 or E1 card, or a USB device). Most smaller setups will not have DAHDI hardware, and this step can be safely skipped.
Some versions of Asterisk will crash with a missing ari.conf https://issues.asterisk.org/jira/browse/ASTERISK-27026
You may wish to “mkdir -p /etc/asterisk && touch /etc/asterisk/ari.conf” after compiling Asterisk
cd/usr/src
tarxvfz asterisk-13-current.tar.gz
rm-f asterisk-13-current.tar.gz
cdasterisk-*
contrib/scripts/install_prereqinstall
./configure--libdir=/usr/lib64
contrib/scripts/get_mp3_source.sh
makemenuselect
You will be prompted at the point to pick which modules to build. Most of them will already be enabled, but if you want to have MP3 support (eg, for Music on Hold), you need to manually turn on ‘format_mp3’ on the first page.
After selecting ‘Save & Exit’ you can then continue
make
makeinstall
makeconfig
ldconfig
chkconfig asterisk off
Install Asterisk Soundfiles.
The ‘make install’ above installs a standard low-quality base sound file by default. This is suitable if you are on a small, underpowered system (such as a Rasberry Pi), but on a larger system, you should install higher quality sound files. Note that this installs the (8khz) ‘wav’ sound files and G722 (High Definition ‘Wideband’) audio.
You can now start using FreePBX. Open up your web browser and connect to the IP address or hostname of your new FreePBX server. You will see the Admin setup page, which is where you set your ‘admin’ account password, and configure an email address to receive update notifications.