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 ****

Install Centos 7

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

In /etc/sysconfig/selinux , change the following lines:

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

yum -y update
yum -y groupinstall core base "Development Tools"

Install Additional Required Dependencies

yum -y install lynx mariadb-server mariadb php php-mysql php-mbstring tftp-server \
  httpd ncurses-devel sendmail sendmail-cf sox newt-devel libxml2-devel libtiff-devel \
  audiofile-devel gtk2-devel subversion kernel-devel git php-process crontabs cronie \
  cronie-anacron wget vim php-xml uuid-devel sqlite-devel net-tools gnutls-devel php-pear unixODBC mysql-connector-odbc

Install Legacy Pear requirements

pear install Console_Getopt

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

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 Dependencies for Google Voice (if required)

Install iksemel
 

cd /usr/src
wget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz
tar xf iksemel-*.tar.gz
rm -f iksemel-1.4.tar.gz
cd iksemel-*
./configure
make
make install

Add the Asterisk User

adduser asterisk -M -c "Asterisk User"

Install and Configure Asterisk

Download Asterisk source files.

cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.7.tar.gz
wget http://www.pjsip.org/release/2.4/pjproject-2.4.tar.bz2

Compile and install DAHDI

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.

cd /usr/src
tar xvfz dahdi-linux-complete-current.tar.gz
tar xvfz libpri-current.tar.gz
rm -f dahdi-linux-complete-current.tar.gz libpri-current.tar.gz
cd dahdi-linux-complete-*
make all
make install 
make config
cd /usr/src/libpri-*
make
make install

Compile and install pjproject

cd /usr/src
tar -xjvf pjproject-2.4.tar.bz2
rm -f pjproject-2.4.tar.bz2
cd pjproject-2.4
CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound\
  --disable-resample --disable-video --disable-opencore-amr --libdir=/usr/lib64
make dep
make
make install

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-13-current.tar.gz
rm -f asterisk-13-current.tar.gz
cd asterisk-*
contrib/scripts/install_prereq install
./configure --libdir=/usr/lib64
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.

After selecting 'Save & Exit' you can then continue

make
make install
make config
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 soundfiles. Note that this installs the (8khz) 'wav' soundfiles and G722 (High Definition 'Wideband') audio.

cd /var/lib/asterisk/sounds
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
tar xvf asterisk-core-sounds-en-wav-current.tar.gz
rm -f asterisk-core-sounds-en-wav-current.tar.gz
tar xfz asterisk-extra-sounds-en-wav-current.tar.gz
rm -f asterisk-extra-sounds-en-wav-current.tar.gz
# Wideband Audio download
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-g722-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-g722-current.tar.gz
tar xfz asterisk-extra-sounds-en-g722-current.tar.gz
rm -f asterisk-extra-sounds-en-g722-current.tar.gz
tar xfz asterisk-core-sounds-en-g722-current.tar.gz
rm -f asterisk-core-sounds-en-g722-current.tar.gz

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/^\(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

Download and install FreePBX.

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

That's it!

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. 

We hope you enjoy using FreePBX 13!

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.

  • No labels

23 Comments

  1. I followed this guild exactly, but it looks my system missed the odbc settings:

    [2015-09-29 02:26:49] WARNING[8560]: res_calendar.c:542 ast_calendar_register: Calendar support disabled, not loading ical calendar module
    Loading res_calendar_caldav.so.
    [2015-09-29 02:26:49] WARNING[8560]: res_calendar.c:542 ast_calendar_register: Calendar support disabled, not loading caldav calendar module
    Loading res_calendar_ews.so.
    [2015-09-29 02:26:49] WARNING[8560]: res_calendar.c:542 ast_calendar_register: Calendar support disabled, not loading ews calendar module
    Loading cdr_sqlite3_custom.so.
    [2015-09-29 02:26:49] WARNING[8560]: cdr_sqlite3_custom.c:162 load_config: Failed to load configuration file. Module not activated.
    Loading cdr_syslog.so.
    [2015-09-29 02:26:49] ERROR[8560]: cdr_syslog.c:143 load_config: Unable to load cdr_syslog.conf. Not logging custom CSV CDRs to syslog.
    Loading cdr_csv.so.
    == Parsing '/etc/asterisk/cdr.conf': Found
    Loading cdr_manager.so.
    [2015-09-29 02:26:49] WARNING[8560]: cdr_manager.c:214 load_config: Failed to load configuration file. Module not activated.
    == Unregistered 'cdr_manager' CDR backend
    Loading cdr_odbc.so.
    [2015-09-29 02:26:49] WARNING[8560]: cdr_odbc.c:205 odbc_load_module: cdr_odbc: Unable to load config for ODBC CDR's: cdr_odbc.conf

    -----------------------------------------------

    isql  show can not connect

    [root@localhost lib]# isql mysql
    [ISQL]ERROR: Could not SQLConnect

    Under CLI, run odbc show status, it comes out none:

    *CLI> odbc show status

    ODBC DSN Settings
    --------------------------------------------------

    Do you have any idea for that?

    1. Please bring this to the forums.

  2. Followed this tutorial on a Digital Ocean Droplet.

    At the end I got, "You have successfully installed FreePBX".

    I then followed this: 

    That's it!

    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. 

    When I go to the IP of the server and IP of server /admin, I get

    This webpage is not available

     

    I know this is a newb mistake but what am I missing?

     

    IP is: 

    • 45.55.84.32

     



     

    1. In case anyone else encounters this, it was a firewall issue. 

      I added

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

      firewall-cmd --reload

      Then, re-started FreePBX

      systemctl start freepbx

      systemctl status -l freepbx.service  (this produced the success output)


      Then, restarted Apache

      systemctl restart httpd.service


      Then, the FreePBX GUI appeared  (wink)

       

       




       

      1. That is actually already there, under the heading "Firewalld Basic Configuration". Do you think it should be more obvious?

        1. Rob:

          Trust me, I know and I followed the instructions verbatim which is why I couldn't figure out at the end why it wasn't working. In this instance, I had to actually issue those commands twice.

          I've since done it again on another server and didn't have the issue.  

  3. Wondered if there was a reason why the source files weren't removed from /usr/src after the make install is complete? Or can they comfortably be cleared away?

  4. Hi, i install all without problem but when i reboot the server and try to go on freepbx page on the right is write CANNOT CONNECT TO ASTERISK

    i try to copy the automatic startup but it not work.

    How i can make this automati startup?

    1. Hi dirweb , did you do the steps on the start up configuration page which is mentioned right at the end of the instructions above? It is necessary to change how asterisk is started as is explained there.

  5. hi neil,

    i copy all commands above, which one you mean?

    1. The very last line, with a link to another page ...

  6. yes i followed this step but after launch the command "chkconfig" it working.

    The only problem now is with extensions, i copyed al the configuration from the old server and make the same in this new server but extension not connect to the host.

    I possible i have some firewall active or other who block the connetions? Or port 5060 is closed?

    1. A couple of questions:

      • What platform are you using (standard PC, raspberry pi ...)
      • Have you disabled SELinux?
      • Are you running firewalld (try running 'systemctl status firewall' and see what it says)

       

  7. Hi neil

    i'm using a cloud server where installed asterisk with freepbx and i use voip phone for connect.

    Selinux is disabled

    And i don't undestand what problem give me "systemctl status firewall", i paste the result:

     

    [root@freepbx ~]# sestatus

    SELinux status:                 disabled

    [root@freepbx ~]# systemctl status firewall

    ● firewall.service

       Loaded: not-found (Reason: No such file or directory)

       Active: inactive (dead)

    1. The reason I ask about firewalld is that it is sometimes installed with the process described in the article above, and by default it will block post ports. With apologies, I used the wrong command. Could you run these two commands please (note the d on the first one only):

      systemctl status firewalld.service

      firewall-cmd --state

       

  8. hi neil, maybe i have almost finished (i hope)

    Yesterday i opened 5060 port and now the extensions connect to the server.

    The problems are:

    • if i make an internal call... i not hear nothing in the headphones
    • if a make a call from my voip server to my mobile phone... i not hear nothing in the headphones

    If i call from my mobile phone to my voip server i have not problem.
    Maybe i have to open other?

    Running your commands i have it:

    systemctl status firewalld.service

    ● firewalld.service - firewalld - dynamic firewall daemon

       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)

       Active: active (running) since Tue 2016-02-23 10:28:18 CET; 37s ago

     Main PID: 763 (firewalld)

       CGroup: /system.slice/firewalld.service

               └─763 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

     

    Feb 23 10:28:13 localhost.localdomain systemd[1]: Starting firewalld - dynami...

    Feb 23 10:28:18 localhost.localdomain systemd[1]: Started firewalld - dynamic...

    Hint: Some lines were ellipsized, use -l to show in full.

    [root@freepbx ~]# firewall-cmd --state

    running

     

     

     

    1. Ok, so it looks like firewalld is running and the phones are registering. Therefore the core system is installed correctly, which is what this page is about. I'm afraid I don't know about the port configurations you will need for you combination of handsets and so on - searching on terms like 'asterisk handset registered but no audio' should take you to people who know answers to those type of questions.

    2. I would not call this a SAFE configuration, but here's what I did to get my home lab working.  The first two commands get sip working (call control), the second two allow RTP to work (audio).  You could narrow this down based on what you're actually using, and by actually using more intelligence than I have about SIP/RTP ports and protocols.  Look in your Asterisk SIP Settings to see your RTP port ranges (default when I installed 13 today was 10000 through 20000).

      firewall-cmd --zone=public --add-port=5060-5061/tcp --permanent
      firewall-cmd --zone=public --add-port=5060-5061/udp --permanent
      firewall-cmd --zone=public --add-port=10000-20000/tcp --permanent
      firewall-cmd --zone=public --add-port=10000-20000/udp --permanent
      firewall-cmd --reload
  9. Looks like the install and configure asterisk box needs a bump in the version for libpri.   That url is no longer valid.

    "wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz" - No longer exists as the next revision 1.5 has taken the base directory.

     

    Should probably point to:

    http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz

     

     

  10. hi guys 

    what about google voice ?

     

    This module requires Asterisk chan_motif & res_xmpp to be installed and loaded

     

    any help ?

     

     

  11. also how can i uninstall freepbx 13 ??

     

  12. Dr Virus I had a similar issue yesterday and nuked my VPS to rebuild... but I think I've found the resolution now.
    First thing I'll have you do is check what user you're running asterisk under (ps aux |grep -v grep| asterisk)
    Come join us on freenode at #freepbx 


    Things to note about this set-up instruction:

    The tar commands "xfz" aren't actually doing ANYTHING, replaced all with "xvf" works for me now.

    The Iksemel package is no longer hosted at the given location. Version 1.5 is available from source on git, but did not compile correctly for me.
    Version 1.4 is available from Fedora Project 

    wget http://pkgs.fedoraproject.org/repo/pkgs/iksemel/iksemel-1.4.tar.gz/532e77181694f87ad5eb59435d11c1ca/iksemel-1.4.tar.gz

    Better option: iksemel-devel available, (Not sure if it was in EPEL or in freepbx repo)

    When install is complete you get a security error on logon, last step after system boots Asterisk and FreePBX for the first time:
    fwconsole chown

    fwconsole ma refreshsignatures
    fwconsole reload
    Also highly recommend making the linked freepbx.service start init script
  13. hi ,when i try the last part ./install -n i get this error

     

    [root@localhost freepbx]# ./install -n

    PHP Parse error:  syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /usr/src/freepbx/amp_conf/htdocs/admin/libraries/Composer/vendor/symfony/console/Helper/QuestionHelper.php on line 85

     

     please guide me