nginx安装以及Nginx中集成nginx-rtmp-module

1.     Nginx需要的三大组件。

实践成功的有如下面的列表:

nginx-1.10.1.tar.gz

openssl-OpenSSL_1_0_1i.tar

pcre-8.38.tar

zlib-1.2.8.tar

 

2.     将以上所需文件上传到liunx上(我这里是CentOS6.8),并利用命令(tar –zxvf 文件名)

3       切换到nginx所在的目录。

4  执行以下命令./configure --prefix=/usr/local/nginx

--with-pcre=/home/Dmain/pcre-8.35

--with-zlib=/home/Dmain/zlib-1.2.8

--with-openssl=/home/Dmain/openssl-OpenSSL_1_0_1i

(ps:以上—with-pcre,--with-zlib,--with-openssl,--add-module之间以空格隔开,这里为了排版将他们回车了。)

5.     执行make命令

6.     执行make install命令

Ps:当执行make,或者makeinstall 的时候注意末尾的提示信息,有的会因为版本问题或者编译不通过。

  Nginx中集成nginx-rtmp-module

注解:nginx-rtmp-module 为流媒体的集成整合模块。提供rtmp协议的服务端。

以下为整合步骤:

1.     上传nginx-rtmp-module-1.1.7.tar.gz

2.     解压nginx-rtmp-module-1.1.7.tar.gz

3.     切换到nginx的目录当中。

4.     执行以下命令、

./configure --prefix=/usr/local/nginx

--with-pcre=/home/Dmain/pcre-8.35

--with-zlib=/home/Dmain/zlib-1.2.8

--with-openssl=/home/Dmain/openssl-OpenSSL_1_0_1i

--add-module=/home/Dmain/nginx-rtmp-module-1.1.7

5. 将工作目录切换到nginx的安装目录ps:不是解压目录):/usr/local/nginx

5.     编辑conf下面的nginx.conf文件使nginx支持rtmp协议

6.      新添加的信息如下:在http上添加:

rtmp {

server {

listen1935;

chunk_size4000;

        #HLS

        # For HLS to work please create adirectory in tmpfs (/tmp/app here)

        # for the fragments. The directorycontents is served via HTTP (see

        # http{} section in config)

        #

        # Incoming stream must be in H264/AAC.For iPhones use baseline H264

        # profile (see ffmpeg example).

        # This example creates RTMP stream frommovie ready for HLS:

        #

        # ffmpeg -loglevel verbose -re -imovie.avi  -vcodec libx264

        #   -vprofile baseline -acodec libmp3lame -ar 44100 -ac 1

        #   -f flv rtmp://localhost:1935/hls/movie

        #

        # If you need to transcode live streamuse 'exec' feature.

        #

applicationhls{

live on;

hls on;

hls_path/tmp/app;

hls_fragment5s;

        }

    }

}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值