| images | add user, extension, and gateway sections | |
| README.md | add bash code block styling | |
Triển khai fusionPBX trên Debian 12
Các lệnh ở các phần sau được thực hiện dưới quyền root.
Cấu hình SSH daemon
Phần này không bắt buộc, nếu muốn thực hiện cần cài đặt
ssh clientở phía máy cá nhân.
Để ngăn chặn brute force attack, cấu hình kết nối đến máy chủ chỉ bằng ssh keys:
Tạo ssh key ở phía máy cá nhân và chọn đường dẫn để lưu file:
ssh-keygen -C "fusionpbx-debian"
Ở đây chọn đường dẫn là /home/kakapt/.ssh/fusion
Copy file public key /home/kakapt/.ssh/fusion.pbx vừa tạo lên server:
ssh-copy-id -i ~/.ssh/fusion.pub root@45.77.33.187
Copying ssh public key to server
Tạo file /etc/ssh/sshd_config.d/20-force_publickey_auth.conf trên server:
cat << eof > /etc/ssh/sshd_config.d/20-force_publickey_auth.conf
PasswordAuthentication no
AuthenticationMethods publickey
Sau đó, reboot lại server:
reboot
Cài đặt FusionPBX
Chạy 3 lệnh sau ở phía server:
apt update && apt upgrade
wget -O - https://raw.githubusercontent.com/fusionpbx/fusionpbx-install.sh/master/debian/pre-install.sh | sh;
cd /usr/src/fusionpbx-install.sh/debian && ./install.sh
Sau khi cài đặt thành công, thông tin đăng nhập website của server sẽ hiện ra như sau:
Installation has completed.
Use a web browser to login.
domain name: https://000.000.000.000
username: admin
password: zxP5yatwMxejKXd
The domain name in the browser is used by default as part of the authentication.
If you need to login to a different domain then use username@domain.
username: admin@x.x.x.x
Additional information.
https://fusionpbx.com/support.php
https://www.fusionpbx.com
http://docs.fusionpbx.com
https://www.fusionpbx.com/training.php
Cấu hình fail2ban để ngăn DDOS
Kích hoạt 3 jail [ssh], [freeswitch-ip] và [auth-challenge-ip]:
sed -i.bak '/\(ssh\)\|\(freeswitch-ip\)\|\(auth-challenge-ip\)/ {
n
/enabled/ s/false/true/
}' /etc/fail2ban/jail.local
Reload lại cấu hình cho fail2ban daemon:
systemctl reload fail2ban.service
Cấu hình TLS/SSL với Let's Encrypt
Trỏ tên miền về địa chỉ IP của server và chạy script sau để cài đặt:
/usr/src/fusionpbx-install.sh/debian/resources/letsencrypt.sh
Đoạn script sẽ yêu cầu điền 2 trường là Domain Name và Email Address
Tạo domain để quản lý từng doanh nghiệp
Vào Advanced > Domains > Add, sau đó điền các thông tin:
- Name ở đây là có thể là domain khác của doanh nghiệp hoặc subdomain từ domain chính.
- Nếu là domain của doanh nghiệp của doanh nghiệp thì cần trỏ nó về địa chỉ IP của server.
Cấu hình SIP profile
Vào Advanced > SIP Profiles, ta cần cấu hình 2 phần là internal và external:
Cấu hình rtp-ip và sip-ip của 2 phần là địa chỉ IP của server cho cả 2 phần:
Sau đó thực hiện các bước sau:
- Vào
Status > SIP Status - Chọn nút
Restartở 2 phầnsofia status profile externalvàsofia status profile internal - Chọn nút
Refreshở góc phải trên
Tạo user
Để tạo user, trước tiên ta cần chọn domain ở sidebar bên phải:
Vào Account > Users > Add và điền các trường thông tin:
Tạo extension
Vào Account > Extensions > Add và điền các trường thông tin:
Tạo gateway để kết nối đến SIP provider
Vào Account > Gateways > Add và điền các trường thông tin do SIP provider cung cấp: