ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Building FreePBX 13 on CentOS 7

    IT Discussion
    asterisk linux voip pbx freepbx freepbx 13 centos centos 7
    4
    6
    2.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Based on FreePBX's own instructions, here is a simple build script to get FreePBX 13 up and running on CentOS 7. It's not fully automated, there are a couple spots where it requires input but that's all. For my own purposes I've added the EPEL and fail2ban along with glances, sysstat and htop. You can safely skip those if needed.

      #!/bin/bash
       
      sudo fallocate -l 1G /swapfile
      sudo chmod 600 /swapfile
      sudo mkswap /swapfile
      sudo swapon /swapfile
      echo "/swapfile   none    swap    sw    0   0" >> /etc/fstab
       
      yum -y install epel-release
      yum -y install sysstat fail2ban glances htop
       
      sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux
      sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
      setenforce disabled
      yum -y update
      yum -y groupinstall core base "Development Tools"
      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
       
      pear install Console_Getopt
       
      systemctl start firewalld
      systemctl enable firewalld
      firewall-cmd --zone=public --add-port=80/tcp --permanent
      firewall-cmd --reload
       
      systemctl enable mariadb.service
      systemctl start mariadb
       
      systemctl enable httpd.service
      systemctl start httpd.service
       
      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
       
      adduser asterisk -M -c "Asterisk User"
       
      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
       
      #pjsip
      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
       
      #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
       
      #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
       
      make
      make install
      make config
      ldconfig
      chkconfig asterisk off
       
      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
       
      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/
       
      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
       
      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
      /sbin/chkconfig asterisk on
       
      mysql_secure_installation
       
      reboot
      
      JaredBuschJ black3dynamiteB 2 Replies Last reply Reply Quote 2
      • JaredBuschJ
        JaredBusch @scottalanmiller
        last edited by

        @scottalanmiller DId you do this without manually adding fail2ban? Because one of the big features of FreePBX now is their responsive firewall setup, which does use fail2ban anyway.

        1 Reply Last reply Reply Quote 0
        • black3dynamiteB
          black3dynamite @scottalanmiller
          last edited by

          @scottalanmiller
          https://iksemel.googlecode.com/files/iksemel-1.4.tar.gz is not available.

          I had to get the file from http://pkgs.fedoraproject.org/repo/pkgs/iksemel/iksemel-1.4.tar.gz/532e77181694f87ad5eb59435d11c1ca/

          1 Reply Last reply Reply Quote 1
          • xrobauX
            xrobau
            last edited by

            /sbin/chkconfig asterisk on

            Woooooah there. That's wrong. You MUST use fwconsole start to start everything, otherwise the daemons and other assorted bits and pieces don't get started in the right order, and things will become flakey.

            There's a systemd startup for FreePBX here:

            http://wiki.freepbx.org/display/FOP/Example+systemd+startup+script+for+FreePBX

            Everything else looks fine.

            I'd really like to get the instructions AWAY from 'compile everything from source', but I haven't had time to look at what's broken (if anything) in the Asterisk RPMs.

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @xrobau
              last edited by

              @xrobau said in Building FreePBX 13 on CentOS 7:

              /sbin/chkconfig asterisk on

              Woooooah there. That's wrong. You MUST use fwconsole start to start everything, otherwise the daemons and other assorted bits and pieces don't get started in the right order, and things will become flakey.

              There's a systemd startup for FreePBX here:

              http://wiki.freepbx.org/display/FOP/Example+systemd+startup+script+for+FreePBX

              Everything else looks fine.

              I'd really like to get the instructions AWAY from 'compile everything from source', but I haven't had time to look at what's broken (if anything) in the Asterisk RPMs.

              Ah good. That be part of the issue that we found. Without it, though, Asterisk wasn't running.

              xrobauX 1 Reply Last reply Reply Quote 0
              • xrobauX
                xrobau @scottalanmiller
                last edited by xrobau

                @scottalanmiller fwconsole starts asterisk, and it makes sure it's started and running with the correct UID

                Or it should. It did last time I checked 😎

                Edit: Saying that, I believe I was the last one that messed with that code, so if it's NOT working, it's probably my fault.

                https://github.com/FreePBX/framework/blob/release/13.0/amp_conf/htdocs/admin/libraries/Console/Start.class.php#L147

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post