在ubuntu上 搭建RTMP服务器

2022-05-15  本文已影响0人  rv要努力

查阅网上关于ubuntu如何搭建RTMP服务器和操作学习,但是提供参考的nginx和ssl等库版本不匹配,需要自行到nginx下载网站中查找适合的版本.
记录在搭建RTMP服务器过程中,主要遇到的问题:
(1)nginx ‘struct crypt_data’ has no member named 'current_salt'

vim src/os/unix/ngx_user.c
image.png

(2)nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 错误解决


image.png

(3)ubuntu 如何查看目录文件 : ls
(4)安装遇到404.

apt-get update 或许 sudo apt-get update 或许有用

(5)nginx 指令

// 查看状态
$ sudo systemctl status nginx.service
// 开启 nginx 服务
$ sudo systemctl start nginx.service
// 重启服务
$ sudo systemctl restart nginx.service
// 查看所有服务
$ sudo systemctl list-units --type=service

(6)Ubuntu删除文件夹的命令

rm -rf

(7)修改ubuntu 中用户root的密码

sudo passwd root

(8)切换用户

su root

(9)修改文件指令

vi nginx.conf

(10)查看nginx状态,查看端口号

 ps -ef | grep nginx

(11)强制停止服务

pkill nginx

(12)图片中的冒号后必须要跟着反斜杠不然ls是看不到usr和bin文件

image.png
(14)在 /usr/local/nginx/conf/nginx.conf 中加入
(注意:不是nginx-1.21.0子文件夹conf中的nginx.conf)
rtmp {
    server {
        listen 1935;
        application live {
            live on;
            record off;
        }
    }
}

(13)保存退出后,告诉nginx重新读取配置:

sudo /usr/local/nginx/sbin/nginx -s reload

(14)如果想要重启nginx:

sudo /usr/local/nginx/sbin/nginx -s stop
sudo /usr/local/nginx/sbin/nginx

成功:


image.png

推流效果展示


9ed7ec8f83205661544097d29a88eca2 (1).gif 20220307_110741.gif

参考相关链接:(感谢)
(https://blog.csdn.net/a249130/article/details/78404957),
(https://nginx.org/download/),
(https://blog.csdn.net/weixin_40490238/article/details/82260728),
(https://blog.csdn.net/qq_40183281/article/details/90085220),
(https://www.jianshu.com/p/1cbff1431590)

上一篇下一篇

猜你喜欢

热点阅读