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

    My trials of installing FreePBX

    IT Discussion
    linux freepbx cloudatcost asterisk centos 6
    6
    57
    21.3k
    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.
    • DashrenderD
      Dashrender
      last edited by

      Check the status of iptables and disable them for now to make setup easier. (not my idea, the instructions idea).

      chkconfig iptables --list
      iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off

      It was already off (seems odd, but must be the default for C@C)

      SQL setup time

      chkconfig --level 345 mysqld on
      service mysqld start
      

      Output

      Initializing MySQL database:  WARNING: The host 'c1107372-7807.cloudatcost.com' could not be looked up with resolveip.
      This probably means that your libc libraries are not 100 % compatible
      with this binary MySQL version. The MySQL daemon, mysqld, should work
      normally with the exception that host name resolving will not work.
      This means that you should use IP addresses instead of hostnames
      when specifying MySQL privileges !
      Installing MySQL system tables...
      OK
      Filling help tables...
      OK
      
      To start mysqld at boot time you have to copy
      support-files/mysql.server to the right place for your system
      
      PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
      To do so, start the server, then issue the following commands:
      
      /usr/bin/mysqladmin -u root password 'new-password'
      /usr/bin/mysqladmin -u root -h c1107372-7807.cloudatcost.com password 'new-password'
      
      Alternatively you can run:
      /usr/bin/mysql_secure_installation
      
      which will also give you the option of removing the test
      databases and anonymous user created by default.  This is
      strongly recommended for production servers.
      
      See the manual for more instructions.
      
      You can start the MySQL daemon with:
      cd /usr ; /usr/bin/mysqld_safe &
      
      You can test the MySQL daemon with mysql-test-run.pl
      cd /usr/mysql-test ; perl mysql-test-run.pl
      
      Please report any problems with the /usr/bin/mysqlbug script!
      
                                                                 [  OK  ]
      Starting mysqld:                                           [  OK  ]
      
      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller @Dashrender
        last edited by

        @Dashrender said:

        Because the instructions tell me to...

        There are several make commands in these setup instructions... is that compiling?

        Make is used for a lot of things. But presumably. This seems fishy, though.

        1 Reply Last reply Reply Quote 0
        • DashrenderD
          Dashrender
          last edited by Dashrender

          Onto Apache

          chkconfig --level 345 httpd on
          

          Output

          Starting httpd: httpd: apr_sockaddr_info_get() failed for c1107372-7807.cloudatcost.com
          httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                                     [  OK  ]
          

          Now for PearDB

          pear channel-update pear.php.net
          pear install db-1.7.14
          

          You may receive a warning:
          WARNING: "pear/DB" is deprecated in favor of "pear/MDB2"

          Output

          [root@c1107372-7807 ~]# pear channel-update pear.php.net
          Updating channel "pear.php.net"
          Update of Channel "pear.php.net" succeeded
          [root@c1107372-7807 ~]# pear install db-1.7.14
          WARNING: "pear/DB" is deprecated in favor of "pear/MDB2"
          downloading DB-1.7.14.tgz ...
          Starting to download DB-1.7.14.tgz (133,103 bytes)
          .............................done: 133,103 bytes
          install ok: channel://pear.php.net/DB-1.7.14
          

          I did receive the notice about pear being deprecated - shouldn't these instructions be updated to use the current software?

          And now a reboot.

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

            The package would need to be updated, not just the instructions.

            1 Reply Last reply Reply Quote 0
            • DashrenderD
              Dashrender
              last edited by

              I'm skipping the Google voice stuff - I have an old account, but I don't recall the credentials.

              add Asterisk user

              adduser asterisk -M -c "Asterisk User"
              

              Download Asterisk

              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-1.4-current.tar.gz
              wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
              git clone https://github.com/akheron/jansson.git
              wget http://www.pjsip.org/release/2.2.1/pjproject-2.2.1.tar.bz2
              

              No problems there

              Compile and install DAHDI and LibPRI

              cd /usr/src
              tar xvfz dahdi-linux-complete-current.tar.gz
              tar xvfz libpri-1.4-current.tar.gz
              rm -f dahdi-linux-complete-current.tar.gz libpri-1.4-current.tar.gz
              cd dahdi-linux-complete-*
              make all
              make install
              make config
              cd /usr/src/libpri-1.4.*
              make
              make install
              
              1 Reply Last reply Reply Quote 0
              • DashrenderD
                Dashrender
                last edited by Dashrender

                Compile and install pjproject

                cd /usr/src
                tar -xjvf pjproject-2.2.1.tar.bz2
                cd pjproject-2.2.1
                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/jansson
                autoreconf -i
                ./configure --libdir=/usr/lib64
                make
                make install
                
                1 Reply Last reply Reply Quote 0
                • DashrenderD
                  Dashrender
                  last edited by

                  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
                  

                  Now presented with what options I want to install - per the instruction the only thing I add is Format MP3

                  screen.JPG
                  Click Save and Exit and continue with Asterisk install

                  make
                  make install
                  make config
                  ldconfig
                  
                  1 Reply Last reply Reply Quote 0
                  • DashrenderD
                    Dashrender
                    last edited by

                    Took a while but Asterisk is installed.

                    Installing Asterisk extra sounds

                    mkdir -p /var/lib/asterisk/sounds
                    cd /var/lib/asterisk/sounds
                    wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-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-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
                    
                    1 Reply Last reply Reply Quote 0
                    • DashrenderD
                      Dashrender
                      last edited by Dashrender

                      Here the second omission in the instructions. They don't tell you to change the directory before downloading FreePBX. I will include it here.

                      cd /usr/src
                      wget http://mirror.freepbx.org/freepbx-12.0.3.tgz
                      tar vxfz freepbx-12.0.3.tgz
                      

                      Change some permissions

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

                      Output

                      # chown asterisk. /var/run/asterisk
                      # chown -R asterisk. /etc/asterisk
                      # chown -R asterisk. /var/{lib,log,spool}/asterisk
                      chown -R asterisk. /usr/lib/asterisk
                      chown -R asterisk. /usr/lib64/asterisk
                      mkdir /var/www/html
                      # chown -R asterisk. /usr/lib/asterisk
                      chown: cannot access `/usr/lib/asterisk': No such file or directory
                      # chown -R asterisk. /usr/lib64/asterisk
                      # mkdir /var/www/html
                      mkdir: cannot create directory `/var/www/html': File exists
                      # chown -R asterisk. /var/www/
                      

                      Odd that there is no /usr/lib/asterisk - so I'll just make a mental note
                      the /var/www/html directory already exists - so no big deal

                      1 Reply Last reply Reply Quote 0
                      • DashrenderD
                        Dashrender
                        last edited by Dashrender

                        A few mods to Apache

                        sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini
                        cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_orig
                        sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf
                        service httpd restart
                        

                        Output
                        Stopping httpd: [ OK ]
                        Starting httpd: httpd: apr_sockaddr_info_get() failed for c1115759-27921.cloudatcost.com
                        httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                        [ OK ]

                        I'm going to have to fix apache so it knows it's FQDN

                        1 Reply Last reply Reply Quote 0
                        • DashrenderD
                          Dashrender
                          last edited by Dashrender

                          Configure Asterisk database in MYSQL

                          cd /usr/src/freepbx
                          export ASTERISK_DB_PW=amp109
                          mysqladmin -u root create asterisk 
                          mysqladmin -u root create asteriskcdrdb
                          

                          And set permissions on dbs

                          mysql -u root -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
                          mysql -u root -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
                          mysql -u root -e "flush privileges;"
                          

                          Start Asterisk and install FreePBX

                          cd /usr/src/freepbx
                          ./start_asterisk start
                          ./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW}
                          

                          Output

                          Checking for PEAR DB..OK
                          Checking for PEAR Console::Getopt..OK
                          Using username: asteriskuser
                          Using password: ******
                          Checking user..OK
                          Checking if Asterisk is running..running with PID: 11666..OK
                          Checking for /etc/amportal.conf../etc/amportal.conf does not exist, copying default
                          Creating new /etc/amportal.conf
                          Enter your USERNAME to connect to the 'asterisk' database:
                           [asteriskuser]
                          Enter your PASSWORD to connect to the 'asterisk' database:
                           [amp109]
                          Enter the hostname of the 'asterisk' database:
                           [localhost]
                          Enter a USERNAME to connect to the Asterisk Manager interface:
                           [admin]
                          Enter a PASSWORD to connect to the Asterisk Manager interface:
                           [amp111]
                          Enter the path to use for your AMP web root:
                           [/var/www/html]
                          
                          PHP Warning:  mkdir(): File exists in /usr/src/freepbx/libfreepbx.install.php on line 197
                          [FATAL] Cannot create /var/www/html!
                          

                          Pressing on (the following commands failed because FreePBX didn't do something right (only error noted above - according the instructions on FreePBX.org you can simply re run the install -
                          ./install_amp --installdb --username=asteriskuser --password=${ASTERISK_DB_PW})

                          amportal chown
                          amportal a ma installall
                          amportal a reload
                          amportal a ma refreshsignatures
                          amportal chown
                          

                          And now the system doesn't know amportal command

                          OK I ran the ./install_amp command again and now amportal commands are working.

                          Another mod for FreePBX, then we can start it

                          ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
                          amportal restart
                          

                          Add the Commercial Modules repos

                          cd /usr/src
                          wget -P /etc/yum.repos.d/ -N http://yum.schmoozecom.net/schmooze-commercial/schmooze-commercial.repo
                          yum clean all
                          yum -y install php-5.3-zend-guard-loader sysadmin fail2ban incron ImageMagick
                          service httpd restart
                          amportal a ma download sysadmin
                          amportal a ma install sysadmin
                          
                          1 Reply Last reply Reply Quote 0
                          • DashrenderD
                            Dashrender
                            last edited by

                            And now launching the web portal for the first time.

                            FPBX-first-screen.JPG

                            1 Reply Last reply Reply Quote 0
                            • DashrenderD
                              Dashrender
                              last edited by Dashrender

                              As you can see the system isn't setup to listen to FreePBX's .htaccess files so we have to enable the override to allow these to work.

                              vi /etc/httpd/conf/httpd.conf
                              

                              find the line <Directory "/var/www/html"> then local AllowOverride about 14 lines down.
                              Change AllowOverride = None to AllowOverride = All

                              Save and quit. now reload httpd

                              service httpd restart
                              
                              1 Reply Last reply Reply Quote 0
                              • DashrenderD
                                Dashrender
                                last edited by

                                Awesome - that worked.

                                Nice clean console now..

                                FPBX-second-screen.JPG

                                1 Reply Last reply Reply Quote 0
                                • DashrenderD
                                  Dashrender
                                  last edited by

                                  Time for Server level SIP settings

                                  Click on Settings at the top > Asterisk SIP settings

                                  Type in your external IP address (or if the server is directly on the internet, click the Detect External IP)

                                  Type in the range for your internal networks

                                  Click Submit at the bottom to save the changes.

                                  1 Reply Last reply Reply Quote 0
                                  • DashrenderD
                                    Dashrender
                                    last edited by

                                    OK Hubtech is holding my feet to the fire on these instructions... I need some tweaks I guess.

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

                                      Before doing all of this, did you try the official one line installation method?

                                      https://gist.github.com/monobilisim/7812605

                                      Just copy that script to your machine and run. Have not tested it personally, but it is from the vendor.

                                      DashrenderD 1 Reply Last reply Reply Quote 0
                                      • DashrenderD
                                        Dashrender @scottalanmiller
                                        last edited by

                                        @scottalanmiller said:

                                        Before doing all of this, did you try the official one line installation method?

                                        https://gist.github.com/monobilisim/7812605

                                        Just copy that script to your machine and run. Have not tested it personally, but it is from the vendor.

                                        That distro is OLD

                                        FreePBX Distro 5.211.65

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

                                          Maybe the script still works, though. Haven't looked through it, is it version dependent?

                                          ? 1 Reply Last reply Reply Quote 0
                                          • ?
                                            A Former User @scottalanmiller
                                            last edited by

                                            @scottalanmiller said:

                                            Maybe the script still works, though. Haven't looked through it, is it version dependent?

                                            how would one test this out. i'll give it a shot

                                            ? DashrenderD 2 Replies Last reply Reply Quote 1
                                            • 1
                                            • 2
                                            • 3
                                            • 2 / 3
                                            • First post
                                              Last post