最近又在搭建jitsi的时候出现了新坑,这篇文章会一直持续更新下去。
我使用的是手动安装(Manual installation),官方虽然不推荐这么安装,但是这是你如果你想改里面的源代码那么快速安装和docker是行不通的。
我使用的是Ubuntu18.04,在安装prosody的时候出现了很多问题,下面就记录下吧
不得不吐槽下prosody的网上的资料是真的少
1.我安装的是prosody最新版
输入命令查看版本0.11.5
sudo apt-get update
sudo apt-get install prosody
sudo prosodyctl about
0.115版本较之前有很大的变化,/etc/prosody/目录下,已经没有了之前的conf.avail和conf.d。但是jitsi又需要conf.avail下创建example.cfg.lua配置文件,所以在这里手动创建这2个文件夹
sudo mkdir -p conf.avail conf.d
然后根据jitsi官方教程去配置你example.com,传送门
第一个坑
在我遇到prosody的文档发现他会自己创建个prosody用户,并且以这个用户运行,所以你需要给刚刚创建文件夹赋予prosody用户
sudo chown -R prosody conf.avail conf.d
include你的配置文件
创建好你的自己配置文件
sudo vim /etc/prosody/conf.avail/jitsi.example.com.cfg.lua
添加连接
ln -s /etc/prosody/conf.avail/jitsi.example.com.cfg.lua /etc/prosody/conf.d/jitsi.example.com.cfg.lua
在0.11.5版本中没有自动Include,你需要自己手动去导入你自己的配置文件
vim /etc/prosody/prosody.cfg.lua
翻到末尾,如果没有include,那么你自己添加include
Include "conf.d/*.cfg.lua"
重启出错
运行的时候我出现了以下错误
prosodyctl restart
SSL/TLS: Failed to load ‘/etc/prosody/certs/localhost.key’: Check that the permissions allow Prosody to read this file. (for localhost)
我是没有用到localhost这个domain的,所以很奇怪为什么会去加载这个localhost的证书,最后发现在
vim /etc/prosody/prosody.cfg.lua
中有
VirtualHost "localhost"
直接注释掉
继续重启,出现问题
Error creating context for c2s: No certificate present in SSL/TLS configuration for localhost
网上找了半天没有一个答案,最后发现关键字c2s,在
vim /etc/prosody/prosody.cfg.lua
中有这样的一段配置,默认为true
c2s_require_encryption = true
修改为false后,继续重启出现如下错误
Couldn’t write pidfile at /var/run/prosody/prosody.pid; /var/run/prosody/prosody.pid: No such file or directory
这个错误就很好解决了,没有这个文件,按照第一个坑的思路,新建mkdir -p /var/run/prosody 文件夹,在赋予prosody用户权限,继续重启,重启成功。
开源流媒体的坑还是挺多的,一不小心掉进坑里,不容易爬出来。
如果你遇到其他的问题也欢迎给我留言,有的坑处理多了,忘记写出来。
如果你也想系统的学习流媒体方面的知识,可以star我的https://github.com/daxiondi/webrtc-doc
我们一起为国内开源一个系统的流媒体知识库。