Page tree
Skip to end of metadata
Go to start of metadata

READ FIRST

Manual installations of FreePBX is considered an EXPERTS ONLY exercise. This method of installation is enough to get CORE functionality of FreePBX. Non-commercial modules may not function as expected or detailed in the Wiki's. Certain modules and features may require additional software to be installed and configured on the server.

**** COMMERCIAL MODULES CANNOT BE INSTALLED ON THIS OS ****

For Asterisk 16 you must enable app_macro in make menuselect


Install Centos 8

Initial System Setup

You MUST run all of these commands as the root user!

You MUST disable selinux.  selinux can cause strange behavior during the install

Disable selinux

sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config

reboot, and verify the selinux status by running 'sestatus'. It should say:

SELinux status: disabled

Update Your System

dnf -y update
dnf -y group install "Development Tools"

Add the Asterisk User

adduser asterisk -m -c "Asterisk User"

Firewalld Basic Configuration

You must open port 80 so that you can access the administration interface

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

Install Additional Required Dependencies

dnf config-manager --set-enabled PowerTools
dnf -y install lynx tftp-server unixODBC mariadb-server mariadb httpd ncurses-devel sendmail sendmail-cf newt-devel libxml2-devel libtiff-devel gtk2-devel subversion git wget vim uuid-devel sqlite-devel net-tools gnutls-devel texinfo libuuid-devel libedit-devel
dnf config-manager --set-disabled PowerTools
dnf install -y http://na.mirror.garr.it/mirrors/MySQL/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.19-1.el8.x86_64.rpm
dnf install -y epel-release
dnf install -y libid3tag
dnf install -y https://forensics.cert.org/cert-forensics-tools-release-el8.rpm
dnf --enablerepo=forensics install -y sox
dnf install -y audiofile-devel
dnf install -y python3-devel

Install php7.2

dnf remove php*
dnf install -y php php-pdo php-mysqlnd php-mbstring php-pear php-process php-xml php-opcache php-ldap php-intl php-soap php-json

Install nodejs

curl -sL https://rpm.nodesource.com/setup_12.x | bash -
dnf install -y nodejs

Enable and Start MariaDB

You must have MariaDB running for freepbx to operate normally.  It must start automatically, and be running continuously.

systemctl enable mariadb.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 chose 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 enable httpd.service
systemctl start httpd.service

Install Legacy Pear requirements

pear install Console_Getopt

Install and Configure Asterisk

Download Asterisk source files.

cd /usr/src
wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.12.tar.gz
http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz

Compile and Install jansson

cd /usr/src
tar vxfz jansson.tar.gz
rm -f jansson.tar.gz
cd jansson-*
autoreconf -i
./configure --libdir=/usr/lib64
make
make install

Compile and install Asterisk

cd /usr/src
tar xvfz asterisk-16-current.tar.gz
rm -f asterisk-*-current.tar.gz
cd asterisk-*
contrib/scripts/install_prereq install
./configure --libdir=/usr/lib64 --with-pjproject-bundled
contrib/scripts/get_mp3_source.sh
make menuselect

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.

If you are using Asterisk 16, enable app_macro.


After selecting 'Save & Exit' you can then continue

make
make install
make config
make samples
ldconfig
chkconfig asterisk off

Set Asterisk ownership permissions.

chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
chown -R asterisk. /usr/lib64/asterisk
chown -R asterisk. /var/www/

Install and Configure FreePBX

A few small modifications to Apache.

sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini
sed -i 's/\(^memory_limit = \).*/\1256M/' /etc/php.ini
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf
sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf
sed -i 's/\(^user = \).*/\1asterisk/' /etc/php-fpm.d/www.conf
sed -i 's/\(^group = \).*/\1asterisk/' /etc/php-fpm.d/www.conf
sed -i 's/\(^listen.acl_users = apache,nginx\).*/\1,asterisk/' /etc/php-fpm.d/www.conf
systemctl restart httpd.service
systemctl restart php-fpm

Download and install FreePBX.

cd /usr/src
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-15.0-latest.tgz
tar xfz freepbx-15.0-latest.tgz
rm -f freepbx-15.0-latest.tgz
cd freepbx
./start_asterisk start
./install -n

That's it!

Reboot the system and 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. 

We hope you enjoy using FreePBX 15!

Automatic Startup

Please note you need to set up FreePBX to start asterisk (and it's associated services) on bootup. You can view an example systemd startup script here.


1 Comment

  1. nodejs version 12 does not work with FreePBX 15; specifically, the UCP nodejs daemon will not run due to failed dependency.