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

相关推荐
tzhou644523 小时前
Docker 部署 Nginx HTTPS 服务(CentOS 7)
nginx·docker·https
等什么君!4 小时前
nginx启动失败 ,报404和 idea端口号被占用的解决办法
运维·nginx
全栈工程师修炼指南5 小时前
Nginx | HTTP 反向代理:当缓存失效时如何减轻后端(上游)服务压力?
运维·网络协议·nginx·http·缓存
zhengxianyi5151 天前
vue 首屏加载优化
前端·javascript·vue.js·nginx·gzip·expires·静态文件缓存
全栈工程师修炼指南1 天前
Nginx | HTTP 反向代理:对上游服务端响应缓存流程浅析与配置实践
运维·网络协议·nginx·http·缓存
Justin_JGT1 天前
flask+uwsgi+Nginx
python·nginx·flask
淡笑沐白1 天前
Nginx 详细教程
运维·nginx
ts9771 天前
Nginx + Vue History 模式刷新 404 的完整排查与解决方案
运维·vue.js·nginx
m0_537473492 天前
Nginx 生产环境平滑升级实战:从 1.24.0 到 1.28.0 的零宕机操作全记录
运维·nginx
BIBI20492 天前
Nginx 反向代理完全入门:从一个真实场景开始
nginx·部署·配置·问题解决·服务器运维·web 开发·web 服务器