重要的事情放前面:一定要看官方文档,不要盲目尝试,一定要有耐心,一定要有耐心。
〇. 本文前提和目标
- 公网ip
- centos服务器
- docker
- docker compose
- 域名和证书
一. 安装docker和docker compose
略
二、安装jitsi meet服务
官网docker 启动jitsimeet的配置参考
2.1 下载稳定版jitsi meet到指定目录
本文存放在/usr/local/software/docker-jitsi-meet
目录下,不要用最新的,因为可能有bug
稳定版地址
2.2 解压并修改配置文件
2.2.1 解压
1 2
| tar -zvxf XXX.tar.gz -C /usr/local/software/docker-jitsi-meet/ cd /usr/local/software/docker-jitsi-meet/
|
2.2.2 修改配置文件
注意:端口尽量保持原来的,笔者曾修改过端口,最终的效果是websocket在第一次链接失败,后续不影响使用,带来莫名错误
拷贝配置文件
修改配置文件
1 2 3 4 5 6 7 8 9 10 11
| HTTP_PORT=8000
HTTPS_PORT=8443
TZ=Asia/Shanghai
PUBLIC_URL=https://你的域名
JVB_ADVERTISE_IPS=需配置公网IP
|
2.2.3 生成密码和创建配置目录
各版本可能有区别,可在上面官网查看
1 2 3 4
| ./gen-passwords.sh
mkdir -p ~/.jitsi-meet-cfg/{web,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri}
|
2.2.4 启动
三、生成证书
参考阿里云即可,略
四、配置nginx证书
4.1 下载和安装nginx
略,但需要注意要安装https模块以及wss升级,因为jitsi会用到websockt
4.2 配置nginx
nginx主要反向代理jitsi的端口是8000,https端口是8443,所以需要配置如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| http { ... server { listen 80; server_name localhost; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $proxy_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} } server { listen 443 ssl; server_name localhost; ssl_certificate 你的证书路径; ssl_certificate_key 你的key路径; location /xmpp-websocket { proxy_pass https://localhost:8443; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location /colibri-ws { proxy_pass https://localhost:8443; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location / { proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Upgrade $http_upgrade; proxy_pass_header Set-Cookie; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off;
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "POST, GET,PUT,DELETE, OPTIONS"; add_header Access-Control-Allow-Headers "Origin, Authorization, Accept"; add_header Access-Control-Allow-Credentials true;
proxy_pass http://127.0.0.1:8000;
} }
|
4.3 启动nginx
1
| nginx -c /usr/local/nginx/conf/nginx.conf
|
4.4 防火墙和访问验证
4.4.1 放通防火墙协议端口
放通云服务商端口
TCP协议:
4.4.2 验证
在浏览器输入自己的域名即可验证。