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

相关推荐
s_daqing5 小时前
ubuntu(arm)使用nginx安装静态服务器
服务器·nginx·ubuntu
物有本木6 小时前
httpsok-v2.0.8发布-支持IIS证书自动续签
nginx·ssl
Volunteer Technology6 小时前
Nginx部署静态项目
运维·服务器·nginx
摇滚侠8 小时前
尚硅谷 Nginx 教程(亿级流量 Nginx 架构设计),基本使用,笔记 6-42
java·笔记·nginx
衫水9 小时前
Ubuntu 系统部署 Vue/Vite 应用到 Nginx
vue.js·nginx·ubuntu
资料库019 小时前
LVS、Nginx、HAProxy核心区别是什么?
运维·nginx·lvs
Filotimo_1 天前
Nginx 的概念
运维·nginx
Shi_haoliu2 天前
SolidTime 在 Rocky Linux 9.5 上的完整部署流程
linux·运维·nginx·postgresql·vue·php·laravel
zhengxianyi5152 天前
vue-cli build, vite build 生产部署刷新或弹窗404,页面空白修复方法
前端·javascript·vue.js·nginx·生产部署
zhengxianyi5152 天前
vite build 发布到nginx二级目录——将yudao-ui-go-view打包、部署到big目录下
vue.js·nginx·vite·前后端分离·打包·ruoyi-vue-pro优化·部署运维