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]# lsinfo.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/sremote: Total 132026 (delta 2), reused 1 (delta 1), pack-reused 132022Receiving 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.origmkdir /usr/local/freeswitchcp -R /var/www/html/resources/templates/conf/* /usr/local/freeswitch
- Copy music directories to default location
mkdir -p /usr/share/freeswitch/sounds/music/defaultmv /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 apacheapache: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.confsed -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 daemondaemon: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.servicenano /etc/systemd/system/freeswitch.service
[Unit]Description=freeswitchWants=network-online.targetRequires=network.target local-fs.targetAfter=network.target network-online.target local-fs.targetAfter=httpd.service mariadb.service[Service]Type=forkingEnvironment="DAEMON_OPTS=-nonat"EnvironmentFile=-/etc/default/freeswitchExecStartPre=/bin/chown -R freeswitch:daemon /usr/local/freeswitchExecStart=/usr/bin/freeswitch -u freeswitch -g freeswitch -ncwait $DAEMON_OPTSTimeoutSec=45sRestart=alwaysUser=rootGroup=daemonLimitCORE=infinityLimitNOFILE=100000LimitNPROC=60000LimitSTACK=250000LimitRTPRIO=infinityLimitRTTIME=infinityIOSchedulingClass=realtimeIOSchedulingPriority=2CPUSchedulingPolicy=rrCPUSchedulingPriority=89UMask=0007NoNewPrivileges=false[Install]WantedBy=multi-user.target
systemctl daemon-reloadsystemctl restart freeswitch.servicesystemctl status freeswitch.service
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.
0 comments