mirror of
https://gitee.com/270580156/weiyu.git
synced 2025-12-30 02:42:25 +00:00
Janus WebRTC Server
配置文件
# 修改 cd /opt/janus/etc/janus/janus.transport.http.jcfg
general: {
ip = "0.0.0.0"
}
admin: {
admin_http = true
admin_ip = "0.0.0.0"
}
前台运行
# 安装路径
cd /opt/janus
# 配置文件
./etc/janus/janus.jcfg
# 查看帮助
./bin/janus --help
# 前台启动
./bin/janus
# 查看端口占用情况
netstat -ntlp | grep janus
后台运行
方法一:使用脚本(推荐)
# 给脚本添加执行权限
chmod +x deploy/janus/start.sh
chmod +x deploy/janus/stop.sh
chmod +x deploy/janus/status.sh
# 启动服务
./deploy/janus/start.sh
# 停止服务
./deploy/janus/stop.sh
# 查看状态
./deploy/janus/status.sh
方法二:使用 systemd 服务
# 复制服务文件到系统目录
sudo cp deploy/janus/janus.service /etc/systemd/system/
# 重新加载 systemd 配置
sudo systemctl daemon-reload
# 启用服务(开机自启)
sudo systemctl enable janus
# 启动服务
sudo systemctl start janus
# 停止服务
sudo systemctl stop janus
# 重启服务
sudo systemctl restart janus
# 查看状态
sudo systemctl status janus
# 查看日志
sudo journalctl -u janus -f
方法三:使用 nohup 命令
# 后台启动并重定向输出
nohup /opt/janus/bin/janus > /opt/janus/logs/janus.log 2>&1 &
# 查看进程
ps aux | grep janus
# 停止进程
pkill -f janus