Yêu cầu

Disk: 25 GB
RAM: 2GB
vCPU: 2
Operating System: Centos 8
Service: FreePBX
Database: MariaDB
PHP: 7.2

Step #01: Kiểm tra version IP và disable SELinux.

[root@localhost ~]# cat /etc/redhat-release
[root@localhost ~]# ip r
[root@localhost ~]# dnf -y update
[root@localhost ~]# sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux
[root@localhost ~]# sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
[root@localhost ~]# sestatus
[root@localhost ~]# reboot

Step #02: Cài đặt firewall và allow port FreePBX.

[root@localhost ~]# dnf -y group install "Development Tools"
[root@localhost ~]# adduser asterisk -m -c "Asterisk User"
[root@localhost ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent
[root@localhost ~]# firewall-cmd --zone=public --add-port=443/tcp --permanent
[root@localhost ~]# firewall-cmd --zone=public --add-port=5060/tcp --permanent
[root@localhost ~]# firewall-cmd --zone=public --add-port=5060/udp --permanent
[root@localhost ~]# firewall-cmd --zone=public --add-port=5160/tcp --permanent
[root@localhost ~]# firewall-cmd --zone=public --add-port=5160/udp --permanent
[root@localhost ~]# firewall-cmd --zone=public --add-port=10000-20000/udp --permanent
[root@localhost ~]# firewall-cmd --reload

Step #03: Cài đặt webserver httpd và database server MariaDB.

[root@localhost ~]# dnf config-manager --set-enabled PowerTools
[root@localhost ~]# dnf -y install lynx tftp-server unixODBC mariadb-server mariadb httpd ncurses-devel sendmail sendmail-cf newt-devel libxml2-devel libtiff-devel gtk2-devel subversion git wget vim uuid-devel sqlite-devel net-tools gnutls-devel texinfo libuuid-devel libedit-devel
[root@localhost ~]# dnf config-manager --set-disabled PowerTools
[root@localhost ~]# dnf install -y http://na.mirror.garr.it/mirrors/MySQL/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.19-1.el8.x86_64.rpm
[root@localhost ~]# systemctl enable mariadb.service
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# systemctl enable httpd.service
[root@localhost ~]# systemctl start httpd.service

Step #04 : Setup python, php và nodejs

[root@localhost ~]# dnf install -y epel-release
[root@localhost ~]# dnf install -y libid3tag
[root@localhost ~]# dnf install -y https://forensics.cert.org/cert-forensics-tools-release-el8.rpm
[root@localhost ~]# dnf --enablerepo=forensics install -y sox
[root@localhost ~]# dnf install -y audiofile-devel
[root@localhost ~]# dnf install -y python3-devel
[root@localhost ~]# dnf remove php*
[root@localhost ~]# dnf install -y php php-pdo php-mysqlnd php-mbstring php-pear php-process php-xml php-opcache php-ldap php-intl php-soap php-json
[root@localhost ~]# curl -sL https://rpm.nodesource.com/setup_12.x | bash -
[root@localhost ~]# dnf install -y nodejs
[root@localhost ~]# pear install Console_Getopt

Step #05: Download và install asterisk, jansson.

[root@localhost ~]# cd /usr/src
[root@localhost src]# wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.12.tar.gz
[root@localhost src]# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
[root@localhost src]# tar vxfz jansson.tar.gz
[root@localhost src]# rm -f jansson.tar.gz
[root@localhost src]# cd jansson-*
[root@localhost jansson-2.12]# autoreconf -i
[root@localhost jansson-2.12]# ./configure --libdir=/usr/lib64
[root@localhost jansson-2.12]# make
[root@localhost jansson-2.12]# make install
[root@localhost jansson-2.12]# cd /usr/src
[root@localhost src]# tar xvfz asterisk-16-current.tar.gz
[root@localhost src]# rm -f asterisk-*-current.tar.gz
[root@localhost src]# cd asterisk-*
[root@localhost asterisk-16.10.0]# contrib/scripts/install_prereq install
[root@localhost asterisk-16.10.0]# ./configure --libdir=/usr/lib64 --with-pjproject-bundled
[root@localhost asterisk-16.10.0]# contrib/scripts/get_mp3_source.sh
[root@localhost asterisk-16.10.0]# make menuselect
[root@localhost asterisk-16.10.0]# make
[root@localhost asterisk-16.10.0]# make install
[root@localhost asterisk-16.10.0]# make config
[root@localhost asterisk-16.10.0]# make samples
[root@localhost asterisk-16.10.0]# ldconfig
[root@localhost asterisk-16.10.0]# chkconfig asterisk off
[root@localhost asterisk-16.10.0]# chown asterisk. /var/run/asterisk
[root@localhost asterisk-16.10.0]# chown -R asterisk. /etc/asterisk
[root@localhost asterisk-16.10.0]# chown -R asterisk. /var/{lib,log,spool}/asterisk
[root@localhost asterisk-16.10.0]# chown -R asterisk. /usr/lib64/asterisk
[root@localhost asterisk-16.10.0]# chown -R asterisk. /var/www/

Step #06: Increase PHP upload size và memory limit trên FreePBX.

[root@localhost asterisk-16.10.0]# sed -i 's/\(^upload_max_filesize = \).*/0M/' /etc/php.ini
[root@localhost asterisk-16.10.0]# sed -i 's/\(^memory_limit = \).*/56M/' /etc/php.ini
[root@localhost asterisk-16.10.0]# sed -i 's/^\(User\|Group\).*/ asterisk/' /etc/httpd/conf/httpd.conf
[root@localhost asterisk-16.10.0]# sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf
[root@localhost asterisk-16.10.0]# sed -i 's/\(^user = \).*/asterisk/' /etc/php-fpm.d/www.conf
[root@localhost asterisk-16.10.0]# sed -i 's/\(^group = \).*/asterisk/' /etc/php-fpm.d/www.conf
[root@localhost asterisk-16.10.0]# sed -i 's/\(^listen.acl_users = apache,nginx\).*/,asterisk/' /etc/php-fpm.d/www.conf
[root@localhost asterisk-16.10.0]# systemctl restart httpd.service
[root@localhost asterisk-16.10.0]# systemctl restart php-fpm
[root@localhost asterisk-16.10.0]# cd /usr/src

Step #07 : Download và cài đặt FreePBX v15.0.

[root@localhost src]# wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-15.0-latest.tgz
[root@localhost src]# tar xfz freepbx-15.0-latest.tgz
[root@localhost src]# rm -f freepbx-15.0-latest.tgz
[root@localhost src]# cd freepbx
[root@localhost freepbx]# ./start_asterisk start
[root@localhost freepbx]# ./install -n

Step #08: Login

Vào browser và nhập IP server tiến hành cài đặt module cần thiết http://IP

Lời kết

Như vậy qua bài viết  này các bạn hoàn toàn có thể tự build được một tổng đài nội bộ dùng cho công ty hoặc demo để làm lab trên Centos8. Chúc các bạn thành công!

Bài viết liên quan

One thought on “[Update]Hướng dẫn cài đặt FreePBX 15 trên CentOS 8

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *