nginx安装和直播

1,源码包:wget http://nginx.org/download/nginx-1.15.0.tar.gz,

2,扩展:git clone https://github.com/arut/nginx-rtmp-module.git,

3,解压nginx: tar xf nginx-1.15.0.tar.gz

4,编译./configure --with-http_ssl_module --add-module=../nginx-rtmp-module  出错执行下面的,

5,安装插件:yum install git gcc make pcre-devel openssl-devel

6,make

make install

安装:make && make install,

7,systemctl stop firewalld

8,启动:nginx: /usr/local/nginx/sbin/nginx

  浏览器 执行自己的ip 出现Welcome to nginx 证明    成功

9,修改配置文件/usr/local/nginx/conf/nginx.conf

[root@fxh /usr/local/nginx/conf]#vi nginx.conf

      加:rtmp{

server{

  listen 1935;

  application hls{

  live on;

  record off;

  }

}

}

location /hls { 

            #server hls fragments 

            types{ 

                application/vnd.apple.mpegurl m3u8; 

                video/mp2t ts; 

            } 

            alias /temp/hls; 

            expires -1; 

        } 

10,下载paly.htmlwen已经配置好的文件

11,/usr/local/nginx/sbin/nginx -s stop

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

12,下载obs

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容