https://www.powerpbx.org/content/fusionpbx-v4-freeswitch-v16-centos-v7-install-guide-v1.1

来源:互联网 发布:秃鹰配件淘宝 全套 编辑:程序博客网 时间:2024/05/01 10:31

refer to: https://www.powerpbx.org/content/fusionpbx-v4-freeswitch-v16-centos-v7-install-guide-v1.1



Fusionpbx is a full featured mult-tenant GUI for Freeswitch.  This guide covers the installation of Fusionpbx and Freeswitch® with MariaDB and Apache on CentOS v7. 

Tested on:

CentOS v7
Freeswitch v1.6
FusionPBX v4
MariaDB v5.5

Assumptions:

Console text mode (multi-user.target)
Installation done as root user (#)

Install Prerequisites

Ensure all required packages are installed. 

yum install epel-releaseyum update
yum install git nano httpd mariadb-server php php-common php-pdo php-soap php-xml php-xmlrpc php-mysql php-cli php-imap php-mcrypt mysql-connector-odbc memcached ghostscript libtiff-devel libtiff-tools at

Disable Selinux

Check status

sestatus

If not disabled, set SELINUX=disabled in /etc/selinux/config.  Requires reboot for changes to take effect.

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

Timezone

## FIND YOUR TIMEZONEtzselect## SET TIMEZONE EXAMPLEtimedatectl set-timezone America/Vancouver## CHECK TIMEZONE​timedatectl status

Reboot

To ensure the changes/additions are at their default states.

reboot

Install

Freeswitch

rpm -Uvh http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpmyum install freeswitch-config-vanilla freeswitch-sounds* freeswitch-lang* freeswitch-lua freeswitch-xml-cdr

Database

systemctl start mariadbmysql

From mysql prompt >

CREATE DATABASE freeswitch;GRANT ALL PRIVILEGES ON freeswitch.* TO fusionpbx@localhost IDENTIFIED BY 'somepassword';flush privileges;\q

ODBC

nano /etc/odbc.ini
[freeswitch]Driver   = MySQLSERVER   = 127.0.0.1PORT     = 3306DATABASE = freeswitchOPTION  = 67108864Socket   = /var/lib/mysql/mysql.sockthreading=0MaxLongVarcharSize=65536[fusionpbx]Driver   = MySQLSERVER   = 127.0.0.1PORT     = 3306DATABASE = fusionpbxOPTION  = 67108864Socket   = /var/lib/mysql/mysql.sockthreading=0

Test odbc driver

odbcinst -s -q

Test odbc connection

isql -v freeswitch fusionpbx somepassword quit

Download Fusionpbx

There are fixes and enhancements in our fork so that it will install properly on MySQL.  The developer appears to have addressed them now, so if you want the latest updates you can install from https://github.com/fusionpbx/fusionpbx

Make sure the "." is included at the end of the git clone command.  That tells git to clone into the current directory instead of creating a /fusionpbx subdirectory.

cd /var/www/htmlgit clone -b 4.2 https://github.com/powerpbx/fusionpbx.git .

Copy conf Directory

mv /etc/freeswitch /etc/freeswitch.origmkdir /etc/freeswitchcp -R /var/www/html/resources/templates/conf/* /etc/freeswitch

Apache config

# Add user freeswitch to group apache to avoid problems with /var/lib/php/sessions directory usermod -a -G apache freeswitch# Set http server to run as same user/group as Freeswitchsed -i "s/User apache/User freeswitch/" /etc/httpd/conf/httpd.confsed -i "s/Group apache/Group daemon/" /etc/httpd/conf/httpd.conf# Set webserver to obey any .htaccess files in /var/www/html and subdirs sed -i ':a;N;$!ba;s/AllowOverride None/AllowOverride All/2' /etc/httpd/conf/httpd.conf

Set ownership and permissions

# Ownershipchown -R freeswitch.daemon /etc/freeswitch /var/lib/freeswitch \/var/log/freeswitch /usr/share/freeswitch /var/www/html# Directory permissions to 770 (u=rwx,g=rwx,o='')find /etc/freeswitch -type d -exec chmod 770 {} \;find /var/lib/freeswitch -type d -exec chmod 770 {} \;find /var/log/freeswitch -type d -exec chmod 770 {} \;find /usr/share/freeswitch -type d -exec chmod 770 {} \;find /var/www/html -type d -exec chmod 770 {} \;# File permissions to 664 (u=rw,g=rw,o=r)find /etc/freeswitch -type f -exec chmod 664 {} \;find /var/lib/freeswitch -type f -exec chmod 664 {} \;find /var/log/freeswitch -type f -exec chmod 664 {} \;find /usr/share/freeswitch -type f -exec chmod 664 {} \;find /var/www/html -type f -exec chmod 664 {} \;

Systemd config

nano /etc/systemd/system/freeswitch.service
[Unit]Description=FreeSWITCHWants=network-online.targetAfter=syslog.target network-online.targetAfter=mariadb.service httpd.service[Service]Type=forkingUser=freeswitchExecStartPre=/usr/bin/mkdir -m 0750 -p /run/freeswitchExecStartPre=/usr/bin/chown freeswitch:daemon /run/freeswitchWorkingDirectory=/run/freeswitchPIDFile=/run/freeswitch/freeswitch.pidEnvironmentFile=-/etc/sysconfig/freeswitchExecStart=/usr/bin/freeswitch -ncwait -nonat $FREESWITCH_PARAMSExecReload=/usr/bin/kill -HUP $MAINPID[Install]WantedBy=multi-user.target

Create the $FREESWITCH_PARAMS file for extra parameters.  If freeswitch was installed from RPM this will probably already exist.

nano /etc/sysconfig/freeswitch
## Type:                string## Default:             ""## Config:              ""## ServiceRestart:      freeswitch## if not empty: parameters for freeswitch#FREESWITCH_PARAMS=""

Enable services

systemctl daemon-reloadsystemctl enable mariadbsystemctl enable httpdsystemctl enable freeswitchsystemctl enable memcachedsystemctl restart freeswitch
Fix fs_cli

If fs_cli command does not work with freeswitch running change the following config line. 

nano /etc/freeswitch/autoload_configs/event_socket.conf.xml
<param name="listen-ip" value="127.0.0.1"/>
systemctl restart freeswitch
 
Reboot and browse to the public IP address of the server

 http://xx.xx.xx.xx 

to complete the install using the following:

Username: superadmin (or whatever you want)
Password: somepassword (use whatever you want)

Database Name: fusionpbx
Database Username: fusionpbx
Database Password: somepassword
Create Database Options: check "Create the database"
Create Database Username: root
Create Database Password : (leave blank unless you have already added a root password)

Post install tasks are mandatory.

Post Install

Lock down the database server

mysql_secure_installationsystemctl restart mariadb

Answer Y to everything.

Enable freeswitch database connection

This sets Freeswitch to use mysql instead of sqlite.

nano /etc/freeswitch/autoload_configs/switch.conf.xml
<param name="core-db-dsn" value="freeswitch:fusionpbx:somepassword" /> 
systemctl restart freeswitch

Change Voicemail to Email app configuration

nano +119 /etc/freeswitch/autoload_configs/switch.conf.xml
<param name="mailer-app" value="/usr/bin/php /var/www/html/secure/v_mailto.php"/>                <param name="mailer-app-args" value="-t"/>
systemctl restart freeswitch

Configure firewall

firewall-cmd --permanent --zone=public --add-service={http,https}firewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/tcpfirewall-cmd --permanent --zone=public --add-port={5060,5061,5080,5081}/udpfirewall-cmd --permanent --zone=public --add-port=16384-32768/udpfirewall-cmd --reload

 


阅读全文
0 0