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

相关推荐
还是大剑师兰特3 天前
解决nginx错误:http://localhost:7000正常,http://localhost:7000/map 报错404
nginx·大剑师
xing-xing4 天前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker
PC2005-cloud4 天前
Nginx 防盗链配置实战:用 referer 模块保护网站静态资源
nginx
PHP实战开发录4 天前
Nginx上传大文件为什么报413
nginx·php·开发
Lsetea4 天前
Nginx报No required SSL certificate was sent:mTLS客户端证书排查
运维·nginx·https·ssl·openssl
szephyr5 天前
HTTPS 证书申请与自动续期:acme.sh + Let‘s Encrypt 完整记录
nginx·https·acme.sh·证书续期
Lsetea6 天前
部署证书后提示“证书名称与输入不匹配”:Safari 报错的三层排查
nginx·https·safari·ssl证书·openssl
打工仔折腾 AI6 天前
FastAPI 从本机到生产服务器:Nginx+Gunicorn+Uvicorn 完整部署实录
人工智能·后端·python·nginx·fastapi·gunicorn
Linux运维技术栈7 天前
如何避免绕过CDN的攻击?基于 CDN 回源请求头鉴权的防御实操与安全性剖析
nginx·安全·cdn
Lsetea7 天前
OpenSSL快速生成域名证书:含SAN的自签命令、验证与排错
nginx·https·ssl证书·openssl·自签证书