1.下载安装包并且解压
mkdir nginx
cd nginx
wget https://repo.huaweicloud.com/nginx/nginx-1.17.9.tar.gz
wget https://codeload.github.com/arut/nginx-rtmp-module/tar.gz/v1.2.1
tar -zxvf nginx-1.17.9.tar.gz
unzip master.zip
2.安装基础环境
yum install -y openssl openss-devel
yum install -y zlib zlib-devel
yum install ‐y pcre pcre‐devel
yum install -y unzip
yum install -y gcc-c++
3.编译
cd nginx-1.17.9
##/home/nginx为安装目录,可以自定义##
./configure --prefix=/home/nginx --with-http_ssl_module --add-module=../nginx-rtmp-module
make
make install
4.启动
cd /home/nginx
##启动命令##
./sbin/nginx
##停止命令##
./sbin/nginx -s stop
##重启命令##
./sbin/nginx -s reload
5.打开浏览器测试nginx是否启动成功,出现以下页面即代表nginx启动成功了
6.修改nginx配置文件
cd /home/nginx
vi ./conf/nginx.conf
添加以下内容如下,内容在最外层
rtmp {
server {
listen 11900;
chunk_size 4096;
application live {
live on;
record off;
}
}
}
./sbin/nginx -s reload
7.使用obs工具进行推流
8.使用vlc测试视频流播放