VoIP: (05.02.08) Hướng dẫn cài đặt FusionPBX v4.4 trên CentOS 7 (64bit) trước khi cài đặt FusionPBX cho FreeSwitch v1.6

By , 0 View

Mục tiêu thực hành:
- Tiến hành Download FusionPBX v4.4.
- Copy Directories.
- Thiết lập Apache Web Server.
- Set ownership & permissions.
- Systemd config.
- Thiết lập ban đầu FusionPBX.

Các bước triển khai:
Tiến hành Download FusionPBX v4.4.
[root@localhost ~]# cd /var/www/html
[root@localhost html]# ls
info.php
[root@localhost html]# unlink /var/www/html/info.php
[root@localhost html]# git clone -b 4.4 https://github.com/powerpbx/fusionpbx.git .
Cloning into '.'...
remote: Enumerating objects: 132026, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
Receiving objects:  13% (17352/132026), 24.89 MiB | 2.32 MiB/s  
remote: Total 132026 (delta 2), reused 1 (delta 1), pack-reused 132022
Receiving objects: 100% (132026/132026), 66.64 MiB | 2.48 MiB/s, done.
Resolving deltas: 100% (94865/94865), done.
[root@localhost html]# 

Copy Directories.
- Replace default FreeSwitch conf files bằng FusionPBX conf files.
mv /usr/local/freeswitch /usr/local/freeswitch.orig
mkdir /usr/local/freeswitch
cp -R /var/www/html/resources/templates/conf/* /usr/local/freeswitch

- Copy music directories to default location
mkdir -p /usr/share/freeswitch/sounds/music/default
mv /usr/local/freeswitch/sounds/music/*000/ /usr/share/freeswitch/sounds/music/default/
or
mv /usr/share/freeswitch/sounds/music/default/*000/ /usr/share/freeswitch/sounds/music/default/

Thiết lập Apache Web Server.
- Add user freeswitch to group apache to avoid problems with /var/lib/php/sessions directory
usermod -a -G apache freeswitch
usermod -a -G root freeswitch

[root@localhost etc]# cat /etc/group | grep apache
apache:x:48:freeswitch
[root@localhost etc]# 

- Set HTTP Server to run as same user/group as Freeswitch.
sed -i "s/User apache/User freeswitch/" /etc/httpd/conf/httpd.conf
sed -i "s/Group apache/Group daemon/" /etc/httpd/conf/httpd.conf

- Set Web Server 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 & permissions.
- Ownership
[root@localhost ~]# cat /etc/group | grep daemon
daemon:x:2:freeswitch
[root@localhost ~]# cd /root

chown -R freeswitch.daemon /usr/local/freeswitch /usr/share/freeswitch /usr/bin/freeswitch /var/www/html /tmp

- Directory permissions to 770 (u=rwx,g=rwx,o='')
find /usr/local/freeswitch -type d -exec chmod 777 {} \;
find /usr/share/freeswitch -type d -exec chmod 777 {} \;
find /usr/bin/freeswitch -type d -exec chmod 777 {} \;
find /var/www/html -type d -exec chmod 777 {} \;
find /tmp -type d -exec chmod 777 {} \;

- File permissions to 664 (u=rw,g=rw,o=r)
find /usr/local/freeswitch -type f -exec chmod 777 {} \;
find /usr/share/freeswitch -type f -exec chmod 777 {} \;
find /usr/bin/freeswitch -type f -exec chmod 777 {} \;
find /var/www/html -type f -exec chmod 777 {} \;
find /tmp -type f -exec chmod 777 {} \;

Systemd config.
- Hiệu chỉnh file freeswitch.service như bên dưới.
cat /etc/systemd/system/freeswitch.service
nano /etc/systemd/system/freeswitch.service

[Unit]
Description=freeswitch
Wants=network-online.target
Requires=network.target local-fs.target
After=network.target network-online.target local-fs.target
After=httpd.service mariadb.service

[Service]
Type=forking
Environment="DAEMON_OPTS=-nonat"
EnvironmentFile=-/etc/default/freeswitch
ExecStartPre=/bin/chown -R freeswitch:daemon /usr/local/freeswitch
ExecStart=/usr/bin/freeswitch -u freeswitch -g freeswitch -ncwait $DAEMON_OPTS
TimeoutSec=45s
Restart=always

User=root
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
LimitSTACK=250000
LimitRTPRIO=infinity
LimitRTTIME=infinity
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
NoNewPrivileges=false

[Install]
WantedBy=multi-user.target

systemctl daemon-reload
systemctl restart freeswitch.service
systemctl status freeswitch.service

Thiết lập ban đầu FusionPBX.

Mọi thắc mắc các bạn vui lòng liên hệ với mình thông qua kênh Zalo (Jade Bùi) 076.877.2021.

You Might Also Like

0 comments