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

相关推荐
骇客野人15 小时前
基于Nginx+Eureka+Apollo+Jenkins+SpringBoot Web系统分布式部署方案
nginx·eureka·jenkins
Kendra9191 天前
从 0 到上线:单文件网页 App 部署到阿里云 ECS 全流程(Nginx+Node+PM2+PostgreSQL)
nginx·阿里云·云计算·部署·个人开发·今天吃什么
暖核1 天前
Nginx 从入门到实践:部署、配置、反向代理与负载均衡全解
运维·nginx·负载均衡
.柒宇.1 天前
运维常见面试题_04_Nginx与DNS服务
运维·nginx·面试·dns
NGINX开源社区2 天前
NGINX Ingress Controller 5.5:安全性与性能提升,迁移更轻松
java·服务器·nginx
weixin_307779132 天前
PHP 大文件上传:内存占用、超时与最佳实践
linux·服务器·开发语言·nginx·php
闲云野鹤在人间2 天前
项目实战:LNMP-电商平台-ECshop
linux·运维·nginx·apache·lvs
暖核2 天前
Keepalived 高可用全解析:从 VRRP 原理到生产环境 Nginx 主备切换实践
网络·nginx·智能路由器
SatanII2 天前
403 禁地:Nginx 拒绝所有生者进入
运维·nginx
xianyuCcCcCCCcc2 天前
Nginx 深度解析:从基础架构到反向代理与负载均衡实战全解
linux·运维·nginx·bash·负载均衡