linux 中 nginx-rtmp 安装

编译安装

1、先下载这些东西:

特别注意:nginx-rtmp-module 一定要在linux环境下从git上直接拉下来,否则最后会出错:

[emerg] unknown directive "rtmp"

2、编译辅助模块

cd到openssl、pcre、zlib目录,进行

./configure

make && make install

3、编译nginx模块

cd到nginx目录,执行:

./configure --prefix=/usr/local/nginx --add-module=../nginx-rtmp-module --with-http_ssl_module --with-pcre=../pcre-8.42 --with-openssl=../openssl-1.1.0i --with-zlib=../zlib-1.2.11

make && make install

4、nginx配置,配置rtmp

vi /usr/local/nginx/conf/nginx_rtmp.conf

rtmp { # 配置RTMP模块

    server { # 服务器

        listen 1935; # 监听端口, 默认为1935

        chunk_size 4000; # 数据块大小 4000

        application live { # 应用名称, 可理解为直播房间的名称

            live on; # 直播 [on]开启

        }

    }

}

5、启动nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx_rtmp.conf

非编译安装

1、拷贝前面编译好的包到对应虚拟机上,解压到/usr/local目录下

2、nginx配置,配置rtmp

vi /usr/local/nginx/conf/nginx_rtmp.conf

rtmp { # 配置RTMP模块

    server { # 服务器

        listen 1935; # 监听端口, 默认为1935

        chunk_size 4000; # 数据块大小 4000

        application live { # 应用名称, 可理解为直播房间的名称

            live on; # 直播 [on]开启

        }

    }

}

3、启动nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx_rtmp.conf

参考信息

参考本地目录:

E:\05-tools\12-linux上需要编译的软件\01-nginx-rtmp

参考文章:

https://blog.youkuaiyun.com/liuchen1206/article/details/77771703

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值