nginx与nginx-rtmp-module安装

nginx与nginx-rtmp-module安装

画了好几天图,实在有些乏力,找点有意思的事情做做

觉得视频流传输挺有意思,B站找了些视频,但感觉有些大同小异,讲得不是很清楚

FFmpeg/RTMP/webRTC丨90分钟搞定直播逻辑-推流-流媒体服务器-拉流
流媒体服务器搭建RTMP-RTSP-WebRTC流媒体服务器

也没看太明白,虽然不太需要了解底层原理吧,但感觉还是了解一些为好

总之要在云服务器上安装nginx nginx-rtmp-module这两个东西,先装一下吧

nginx-RTMP + ffmpeg实现远程图传

实验室的博客,也就是陆辉东写的太简略了,还是自己摸索吧

主要参考了下面两篇博客,写得还是很详细的

centos7 nginx rtmp转发流媒体服务器
nginx源码编译安装(详解)

陆师兄编译的时候用了--with-openssl=/usr/local/nginx/src/openssl,帮助文档上

cpp 复制代码
--with-openssl=DIR                 set path to OpenSSL library sources

后面应该是OpenSSL库文件的路径,我之前二进制装的,因此找不到src文件,硬加编译会报错,提示找不到 no such file or directory

cpp 复制代码
[lighthouse@VM-4-11-centos nginx-1.22.0]$ whereis openssl
openssl: /usr/bin/openssl /usr/include/openssl /usr/share/man/man1/openssl.1ssl.gz

第一篇博客中博主没有设置这个参数,所以我也没有设置,大概--with了一些 module

安装完成后

cpp 复制代码
[lighthouse@VM-4-11-centos ~]$ whereis nginx
nginx: /usr/local/nginx
[lighthouse@VM-4-11-centos ~]$ cd /usr/local/nginx/sbin/
[lighthouse@VM-4-11-centos sbin]$ ls
nginx
[lighthouse@VM-4-11-centos sbin]$ ./nginx -v
nginx version: nginx/1.22.0
[lighthouse@VM-4-11-centos sbin]$ ./nginx -V
nginx version: nginx/1.22.0
built by gcc 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC) 
built with OpenSSL 1.1.1k  FIPS 25 Mar 2021
TLS SNI support enabled
configure arguments: --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module --with-http_sub_module --with-http_ssl_module --with-pcre --add-module=/usr/local/src/nginx-rtmp-module

可以看到还是用到了OpenSSL的,同时还给出了 configure arguments

查看*/usr/local/nginx/的目录结构

cpp 复制代码
[lighthouse@VM-4-11-centos nginx-1.22.0]$ cd /usr/local/nginx/
[lighthouse@VM-4-11-centos nginx]$ ls
conf  html  logs  sbin
[lighthouse@VM-4-11-centos nginx]$ tree
.
├── conf
│   ├── fastcgi.conf
│   ├── fastcgi.conf.default
│   ├── fastcgi_params
│   ├── fastcgi_params.default
│   ├── koi-utf
│   ├── koi-win
│   ├── mime.types
│   ├── mime.types.default
│   ├── nginx.conf
│   ├── nginx.conf.default
│   ├── scgi_params
│   ├── scgi_params.default
│   ├── uwsgi_params
│   ├── uwsgi_params.default
│   └── win-utf
├── html
│   ├── 50x.html
│   └── index.html
├── logs
└── sbin
    └── nginx

4 directories, 18 files

官方下载地址

https://github.com/arut/nginx-rtmp-module
https://github.com/nginx/nginx

官方的文档及教程

Beginner's Guide

相关推荐
Agome996 分钟前
Docker之nginx安装
java·nginx·docker
努力买辣条5 小时前
基于Docker的高可用WordPress集群部署:Nginx负载均衡+Mysql主从复制+ProxySQL读写分离
nginx·docker·负载均衡
苹果醋315 小时前
Java并发编程-Java内存模型(JMM)
java·运维·spring boot·mysql·nginx
程序员不迷路20 小时前
Nginx学习
运维·nginx
童先生1 天前
Nginx + Vue/React 前端 + API:防止路径混淆漏洞与跨域问题实战分享
前端·vue.js·nginx
2501_920047032 天前
nginx-自制证书实现
运维·windows·nginx·https
鹧鸪yy3 天前
认识Node.js及其与 Nginx 前端项目区别
前端·nginx·node.js
__lll_3 天前
Nginx proxy_pass 404/502 根源:漏写末尾斜杠 / 的修复指南
nginx
Clownseven4 天前
Docker+Nginx+Node.js实战教程:从零搭建高可用的前后端分离项目
nginx·docker·node.js
水冗水孚5 天前
图文并茂讲解nginx中http升级https(部署SSL证书)知识点总结
nginx·http·https