Howto: Installation of Centos 7.x server with Asterisk 11 and FreePBX 12

From voipsupport
Jump to navigation Jump to search

Centos Installation

1. First download the appropriate ISO image from centos mirrors http://isoredirect.centos.org/centos/7/isos/x86_64/ and install. Centos 7 only supports 64 bit processors. This howto uses the minimal install image: CentOS-7-x86_64-Minimal-1503-01.iso (or a later version).

2. Burn the images to a CD and boot from the CD

Screen1.png

3. Choose language

Screen2.png

4. Configure install options

Screen3.png

5. Configure time zone

Screen4.png

6. Configure networking. Change option to "On" and then click on Configure. Set the network to start automatically. You should also setup the ip address. After clicking on Done, click "Begin installation"

Screen5.png

7. Setup the root password by clicking on the menu item and setting the password.

Screen6.png

8. Once the installation is complete click on Reboot

Screen7.png

9. Boot the system in normal mode (first menu item in boot list)

Screen8.png

10. Login as root

Screen9.png

11. Update system

yum -y update

12. Disable selinux. [Warning: Selinux is a security feature and disabling is not really the right thing to do, though at the moment is seems to be the easiest way to get things working. The correct solution would be to leave Selinux enabled and then submit a Selinux configuration that does not block Asterisk/FreePBX from working. If anyone has time to do that they are more than welcome. In the meantime I assume we will disable it and accept the weakened security as a consequence.] Check the following file:

vi /etc/selinux/config

has this setting:

SELINUX=disabled

reboot (if above setting was changed):

reboot

13. Install additional packages

yum -y install net-tools wget

Mariadb

Centos 7 comes with Mariadb instead of Mysql.

1. Install mariadb if not already present

yum install mariadb-server

2. Setup mariadb to start on boot:

systemctl enable mariadb

3. Start mariadb:

systemctl start mariadb

4. Secure the installation by running following script and answering with defaults:

/usr/bin/mysql_secure_installation

Output:

usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] 
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] 
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] 
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] 
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Apache

1. Install apache and php if not already present

yum -y install httpd php php-pear php-mysql php-process php-mbstring

2. Setup apache to start on boot

systemctl enable httpd

3. Setup the user and group that will be used for asterisk install and configure apache to run with these:

useradd -c "Asterisk PBX" -d /var/lib/asterisk asterisk

4. Change the apache configuration to use the user and group just defined:

vi /etc/httpd/conf/httpd.conf

Change the following lines:

User apache
Group apache

to:

User asterisk
Group asterisk

5. Modify the same file (httpd.conf) to allow apache directives to be overriden in .htaccess files. The modification has to be done in the <Directory> directive of the default server. Be sure to modify the setting in the correct <Directory> directive. It should be something like <Directory "/var/www/html">

AllowOverride All

6. This step should not be needed if installing from the default images since this setting should already be done, however check it to make sure. Modify the same file (httpd.conf) to allow apache to follow symbolic links. The modification has to be done in the <Directory> directive of the default server.

Options FollowSymLinks

7. Setup a default time zone in php configuration file:

vi /etc/php.ini
date.timezone = "Europe/Amsterdam"

See http://php.net/manual/en/timezones.php for full list of supported values.

8. Change the permissions of the session.save_path (as defined in /etc/php.ini)

chgrp -R asterisk /var/lib/php/session/

Note: after doing an update to php, it is necessary to check that the update has not reset the owner of the session.save_path to the default (apache) and if so re-execute the above command.

9. Start the service

systemctl start httpd

For other apache configuration check the apache documentation. If the server will be accessible via the public internet, then an ssl certificate should be setup and apache configured for https access.

10. You will need to open the firewall port for the web server. You may also need to open https if you use it. The line below with --permanent option adds the rule permanently but does not take effect unless the firewalld service is restarted, so the second line adds the rule dynamically

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --zone=public --add-service=http

Dahdi

Only required if using telephony hardware cards. It used to be required as a timing source for meetme conferencing application, but this is no longer the case. See https://wiki.asterisk.org/wiki/display/AST/Timing+Interfaces The installation and configuration of Dahdi has not been covered in this Howto.

Asterisk

1. Install asterisk prerequisites if not already present

yum install wget curl bison perl perl-CPAN openssl-devel kernel-devel audiofile-devel sox svn gcc-c++ make ncurses-devel libxml2-devel mysql-devel sqlite-devel libuuid-devel jansson-devel

If you will use odbc with asterisk you will also need

yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel

And the relevant connector for your database, for example mysql

yum install mysql-connector-odbc

2. Change to a suitable location for storing the downloaded software, for example:

cd /usr/local/src/

3. Download latest version of asterisk (at time of writing this was 10)

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

4. Extract the source directory

tar -xvzf asterisk-12-current.tar.gz

5. Change into the source directory (customize the command to the version that was downloaded)

cd asterisk-12.8.2

6. Get source for fomat_mp3 (not part of downloaded asterisk tar file)

contrib/scripts/get_mp3_source.sh

7. Configure. Centos 7 uses a different libdir from the default one in asterisk configure script. If you don't specify this then you will have to link the lib64 library (ln -s /usr/lib/libasteriskssl.so.1 /usr/lib64/libasteriskssl.so.1) for asterisk to run.

./configure --libdir=/usr/lib64

8. Start compilation of the Asterisk interactive menu for selection of the components to build:

make menuselect

Under Add-ons choose:

<pre>format_mp3
app_mysql
cdr_mysql

Under Core Sound Packages and Extra Sound Packages choose any relevant packages. It is a good idea to install not just gsm but also other codecs, since it reduces cpu needs for transcoding and (depending on codec) can give better quality.

When exiting menuselect, when prompted, press S to save changes.

9. Compile and install asterisk

make
make install

10. Change directory owner and group

chown -R asterisk:asterisk /var/run/asterisk
chown -R asterisk:asterisk /var/log/asterisk
chown -R asterisk:asterisk /var/lib/asterisk
chown -R asterisk:asterisk /var/spool/asterisk
chown -R asterisk:asterisk /etc/asterisk

FreePBX

1. Install prerequisites if not already present. The older version is required for FreePBX 12. Newer versions do not work.

pear install db-1.7.14 unzip

2. Install lame

cd /usr/local/src
wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz  
tar -xvzf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure
make
make install

3. Get and extract the FreePBX source code

cd /usr/local/src
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-12.0-latest.tgz
tar -xvzf freepbx-12.0-latest.tgz
cd freepbx

4. Create and populate databases for configuration and cdrs

mysqladmin -u root -p create asteriskcdrdb
mysql -u root -p asteriskcdrdb < SQL/cdr_mysql_table.sql
mysqladmin -u root -p create asterisk
mysql -u root -p asterisk < SQL/newinstall.sql

5. Create database user to be used by FreePBX to connect to database and give permisisons on databases

mysql -u root -p

at the mysql prompt enter (substitute xxxxxxxx with chosen password): %commandbox% [@GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'xxxxxxxx'; GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost; flush privileges;

quit

6. Start asterisk

./start_asterisk start

7. Correct the install script to avoid an error due to /var/www/html already existing

vi libfreepbx.install.php

on line 199 change:

                $ret=mkdir($directory, $modenum, $recursive);

to:

                if(!is_dir($directory)) 
                        $ret=mkdir($directory, $modenum, $recursive);
                else
                        $ret=true;

8. Run FreePBX install script (using same credentials authorized to mysql). If the script fails, then it will be necessary to remove /etc/amportal.conf before rerunning it. NB the script will fail if you leave the default setting for path for webroot.

./install_amp

Output:

Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking user..OK
Checking if Asterisk is running..running with PID: 2570..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] abcd1234
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] 

Created /var/www/html
Enter the IP ADDRESS or hostname used to access the AMP web-admin:
 [192.168.1.1] 192.168.100.208
Use simple Extensions [extensions] admin or separate Devices and Users [deviceanduser]?
 [extensions] 
Enter directory in which to store AMP executable scripts:
 [/var/lib/asterisk/bin] 

Created /var/lib/asterisk/bin
Enter directory in which to store super-user scripts:
 [/usr/local/sbin] 

/etc/amportal.conf writtenAssuming new install, --install-moh added to command line
OK
Reading /etc/amportal.conf..parsed amp_conf variables from /etc/amportal.conf:
amp_conf [AMPDBHOST] => [localhost]
amp_conf [AMPDBENGINE] => [mysql]
amp_conf [AMPENGINE] => [asterisk]
amp_conf [AMPMGRUSER] => [admin]
amp_conf [AMPMGRPASS] => [amp111]
amp_conf [AMPBIN] => [/var/lib/asterisk/bin]
amp_conf [AMPSBIN] => [/usr/local/sbin]
amp_conf [AMPWEBROOT] => [/var/www/html]
amp_conf [AMPCGIBIN] => [/var/www/cgi-bin ]
amp_conf [FOPWEBROOT] => [/var/www/html/panel]
amp_conf [FOPPASSWORD] => [passw0rd]
amp_conf [AUTHTYPE] => [database]
amp_conf [AMPEXTENSIONS] => [extensions]
amp_conf [AMPDBUSER] => [asteriskuser]
amp_conf [AMPDBPASS] => [abcd1234]
amp_conf [AMPWEBADDRESS] => [192.168.100.208]
amp_conf [AMPDBNAME] => [asterisk]
OK
Checking for /etc/asterisk/asterisk.conf../etc/asterisk/asterisk.conf does not exist, copying default
OK
Reading /etc/asterisk/asterisk.conf..OK
Using asterisk as PBX Engine
Checking for Asterisk version..12.8.2
Checking for selinux..OK
Connecting to database..OK
Checking current version of FreePBX..2.11.0rc1
Installing new FreePBX files..OK (2964 files copied, 0 skipped)
amportal..no fpbx..freepbx_engine..freepbx_setting..gen_amp_conf.php..done
apply username/password changes to conf files:
running apply_conf.sh from /etc/amportal.conf
	Reading /etc/amportal.conf
	Updating configuration...
	/etc/asterisk/cdr_mysql.conf user: [asteriskuser] password: [abcd1234] hostname: [localhost]
	/etc/asterisk/manager.conf user: [admin] secret: [amp111]
	Adjusting File Permissions..
	
	
	SETTING FILE PERMISSIONS..............Done
	Removing any dangling symlinks
	Dangling symlinks removed
	Done
done with apply_conf.sh
creating missing #include files..OK
Module 'manager' reloaded successfully.
Setting permissions on files..OK
Loading Bootstrap..OK
Checking for upgrades..8 found
Upgrading to 2.11.0..
-> Running PHP script /usr/local/src/freepbx/upgrades/2.11.0/migration.php
Upgrading to 2.11.0..OK
Upgrading to 12.0.1alpha16..
-> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1alpha16/upgrade.php
Upgrading to 12.0.1alpha16..OK
Upgrading to 12.0.1alpha31..
-> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1alpha31/upgrade.php
Upgrading to 12.0.1alpha31..OK
Upgrading to 12.0.1alpha45..
-> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1alpha45/upgrade.php
Upgrading to 12.0.1alpha45..OK
Upgrading to 12.0.1beta10..
-> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1beta10/upgrade.php
Upgrading to 12.0.1beta10..OK
Upgrading to 12.0.1beta30..
-> Running PHP script /usr/local/src/freepbx/upgrades/12.0.1beta30/upgrade.php
Upgrading to 12.0.1beta30..OK
Upgrading to 12.0.32..
-> Running PHP script /usr/local/src/freepbx/upgrades/12.0.32/upgrade.php
Upgrading to 12.0.32..OK
Upgrading to 12.0.38..
-> Running PHP script /usr/local/src/freepbx/upgrades/12.0.38/upgrade.php
Upgrading to 12.0.38..OK
Checking core.. updated to 12.0.24
Checking logfiles.. updated to 12.0.6
Checking callrecording.. updated to 12.0.2.5
Checking ucp.. updated to 12.0.9
Checking customappsreg.. updated to 2.11.0.2
Checking featurecodeadmin.. updated to 12.0.1
Checking voicemail.. updated to 12.0.32
Checking cdr.. updated to 12.0.17
Checking infoservices.. updated to 12.0.1
Checking dashboard.. updated to 12.0.23
Checking music.. updated to 12.0.1
Checking sipsettings.. updated to 12.0.9
PHP Notice:  Undefined variable: db in /var/www/html/admin/libraries/cronmanager.class.php on line 92
..OK
Generating AMP configs..
Generating Configurations.conf, (if Asterisk is not running, you will get an error)
In case of error, start Asterisk and hit the red bar in the GUI to generate the Configurations.conf files
Checking for PEAR Console::Getopt..OK
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
Running module install.php and install.sql scripts
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
Skipping extension and destination registry checks
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
PHP Warning:  file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
no crontab for asterisk
no crontab for asterisk
Please update your modules and reload Asterisk by browsing to your server.
Generating AMP configs..OK
Checking core.. Checking if directdids need migrating..already done
updating zap callgroup, pickupgroup..not needed
checking for delay_answer field ..already exists
checking for reversal field ..added
checking for pricid field ..already exists
Checking if trunk table migration required..not needed
Checking if privacy manager options exists..already exists
Checking for noanswer_cid field..already exists
Checking for busy_cid field..already exists
Checking for chanunavail_cid field..already exists
Checking for noanswer_dest field..already exists
Checking for busy_dest field..already exists
Checking for chanunavail_dest field..already exists
Checking for General Setting migrations..not needed
Deleting unused globals..done
Converting IAX notransfer to transfer if needed..updated 0000 records
deleting obsoleted record_in and record_out entries..ok
checking for dest field in outbound_routes..already exists
checking for continue field in trunks..already exists
upgrading any zap trunks to dahdi if foundok
Module core successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module core successfully enabled
installed
Checking logfiles.. Module logfiles successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module logfiles successfully enabled
installed
Checking callrecording.. Module callrecording successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module callrecording successfully enabled
installed
Checking ucp.. dependencies pending
Checking customappsreg.. Module customappsreg successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module customappsreg successfully enabled
installed
Checking featurecodeadmin.. Module featurecodeadmin successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module featurecodeadmin successfully enabled
installed
Checking voicemail.. Checking for General Setting migrations..not needed
checking if Voicemail Admin (vmailadmin) is installed..not installed, ok
Module voicemail successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module voicemail successfully enabled
installed
Checking cdr.. Checking if field did is present in cdr table..
did field already present.
Checking if field recordingfile is present in cdr table..
recordingfile field already present.
Checking if field cnum is present in cdr table..
Adding cnum field to cdr
Added field cnum to cdr
Checking if field cnam is present in cdr table..
Adding cnam field to cdr
Added field cnam to cdr
Checking if field outbound_cnum is present in cdr table..
Adding outbound_cnum field to cdr
Added field outbound_cnum to cdr
Checking if field outbound_cnam is present in cdr table..
Adding outbound_cnam field to cdr
Added field outbound_cnam to cdr
Checking if field dst_cnam is present in cdr table..
Adding dst_cnam field to cdr
Added field dst_cnam to cdr
Creating cel if needed..OK
Module cdr successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module cdr successfully enabled
installed
Checking infoservices.. Module infoservices successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module infoservices successfully enabled
installed
Checking dashboard.. Module dashboard successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module dashboard successfully enabled
installed
Checking music.. Module music successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module music successfully enabled
installed
Checking sipsettings.. checking for sipsettings table..none, creating table
chan_pjsip support detected. Enabling.
populating default codecs..ulaw, alaw, gsm, g726 added
Migrate rtp.conf values if needed and initialize
Migrating Audio Codecs
Module sipsettings successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module sipsettings successfully enabled
installed
Checking ucp.. dependencies pending
Checking ucp.. Detected Missing Dependency of: userman 5.3.3
Downloading Missing Dependency of: userman 5.3.3
Downloading 36840 of 36840 (100%)            

Untaring..Done
Module userman successfully downloaded
Installing Missing Dependency of: userman 5.3.3
Installed Missing Dependency of: userman 5.3.3
Refreshing all UCP Assets, this could take a while...
Generating Module Scripts...Done
Generating Module CSS...Done
Generating Main Scripts...Done
Generating Main CSS...Done
Done!
Module ucp successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Module ucp successfully enabled
installed
Framework has been detected as being in Developer mode, Please make sure to run './install_amp --update-links' manually so that any database or system settings can be updated
Module framework successfully installed

SETTING FILE PERMISSIONS..............Done
Removing any dangling symlinks
Dangling symlinks removed
Please update your modules and reload Asterisk by browsing to your server.

*************************************************************************
* Note: It's possible that if you click the red 'Update Now' bar BEFORE *
* updating your modules, your machine will start dropping calls. Ensure *
* that all modules are up to date BEFORE YOU CLICK THE RED BAR. As long *
* as this is observed, your machine will be fully functional whilst the *
* upgrade is in progress.                                               *
*************************************************************************
****************************************
* At This Time Please Restart Asterisk *
****************************************

9. Stop asterisk

asterisk -rx "core stop now"

10. Start asterisk with amportal script

amportal start

11. Open the FreePBX URL in a browser, http://ip address you specified and create the default admin user

Screen10.png

12. Login to FreePBX at http://ip address you specified, using your credentials and navigate to .

Screen11.png

13. Click the red "Apply config" button.

14. Under Admin->Module admin menu, use “check on line” to check for module updates. Upgrade the Framework module. Click on "Apply config" button.

15. Go back to module administration and upgrade the remaining modules. Click on "Apply config" button.

Later you may go back to module administration and pick further modules from online ones (for example Sip settings, IVR, Queues, Annoucements, Call flow control etc.)

16. You will need to open the firewall port for sip and rtp. The lines below with --permanent option add the rule permanently but does not take effect unless the firewalld service is restarted, so the lines without permanent add the rule dynamically

firewall-cmd --zone=public --add-port=5060-5061/udp
firewall-cmd --permanent --zone=public --add-port=5060-5061/udp
firewall-cmd --zone=public --add-port=10000-20000/udp
firewall-cmd --permanent --zone=public --add-port=10000-20000/udp

17. In order to have amportal start from systemd, it is necessary to modify one of the default settings for sudoers

vi /etc/sudoers

comment out (by putting # in front)

#Defaults    requiretty

18. Place the following file in /usr/lib/systemd/system/amportal.service. If you get a 203/EXEC error when starting up, check that the path to the amportal script is correct (by using the command whereis amportal).

[Unit]
Description=Freepbx
After=network.target remote-fs.target nss-lookup.target httpd.service mariadb.service

[Service]
Type=forking
ExecStart=/usr/local/sbin/amportal start
ExecReload=/usr/local/sbin/amportal reload
ExecStop=/usr/local/sbin/amportal stop
KillSignal=SIGCONT
PIDFile=/var/run/asterisk/asterisk.pid
SuccessExitStatus=1

[Install]
WantedBy=multi-user.target

19. Reload systemd files

systemctl daemon-reload

20. Check that you can successfully start, view the status and stop FreePBX with the following commands

If it was already running stop amportal

<pr>amportal stop

Then start via systemd service

systemctl start amportal.service
systemctl status amportal.service
systemctl stop amportal.service

21. Set to run on startup and then do a reboot to check if asterisk starts up correctly

systemctl enable amportal.service