Cài đặt các gói cần thiết:
yum install epel-release -y && yum update -yyum 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 -yTắt Selinux
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/configĐặt múi giờ
timedatectl set-timezone Asia/Ho_Chi_MinhCấu hình Memcached
nano /etc/sysconfig/memcachedPORT="11211"USER="memcached"MAXCONN="1024"CACHESIZE="64"OPTIONS="-l 127.0.0.1"Reboot server để apply các cấu hình.
Tiến hành cài đặt
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 -yDatabase, không đặt password cho user root
systemctl start mariadbmysqlFrom mysql prompt >
CREATE DATABASE freeswitch;GRANT ALL PRIVILEGES ON freeswitch.* TO fusionpbx@localhost IDENTIFIED BY 'somepassword';flush privileges;\qODBC
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=0Test odbc driver
odbcinst -s -qTest odbc connection
isql -v freeswitch fusionpbx somepassword quitTải Fusionpbx
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/freeswitchApache config
usermod -a -G apache freeswitch# Đăt user/group là Freeswitchsed -i "s/User apache/User freeswitch/" /etc/httpd/conf/httpd.confsed -i "s/Group apache/Group daemon/" /etc/httpd/conf/httpd.confsed -i ':a;N;$!ba;s/AllowOverride None/AllowOverride All/2' /etc/httpd/conf/httpd.confnano /etc/httpd/conf/httpd.confDocumentRoot "/var/www/html/fusionpbx"Cấp quyền cho thư mục và các file
chown -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.targetTạo tệp $ FREESWITCH_PARAMS cho các tham số bổ sung. Nếu freeswitch được cài đặt từ RPM, điều này có thể sẽ tồn tại.
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 restart httpdsystemctl enable freeswitchsystemctl enable memcachedsystemctl restart freeswitchFix 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 freeswitchKhởi động lại server và truy cập địa chỉ IP của server
Tiến hành cài đặt các thông số:
fusionpbxfusionpbxrootĐặt mật khẩu cho mysql
mysql_secure_installationsystemctl restart mariadbEnable 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:123qwe" /> systemctl restart freeswitchConfigure firewall nếu server có sử dụng 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 --reloadVideo hướng dẫn