前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Nginx视频点播安装配置

Nginx视频点播安装配置

作者头像
星哥玩云
发布2022-06-30 20:22:29
1.9K0
发布2022-06-30 20:22:29
举报
文章被收录于专栏:开源部署

创建用户 useradd www

安装linux批量部署 yum groupinstall -y "Development Tools" "Development Libraries"

安装zlib  nginx运行需要的函数库安装openssh 支持安全通信 yum install zlib* openssl* -y安装与perl兼容的正则表达式库模块tar fvxz pcre-8.33.tar.gz./configure makemake install安装libunwind库tar zxf libunwind-1.1.tar.gz cd libunwind-1.1CFLAGS=-fPIC ./configuremake CFLAGS=-fPICmake CFLAGS=-fPIC installecho '/usr/local/lib' > /etc/ld.so.conf.d/usr_local_lib.confldconfig安装gperftools CPU分析器tar zxf gperftools-2.1.tar.gz cd gperftools-2.1./configure makemake installldconfig  安装伪流模块 tar zxf nginx_mod_h264_streaming-2.2.7.tar.gz注释 nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c 158行的if代码

下载nginx视频模块

wget https://github.com/arut/nginx-rtmp-module.git

nginx-rtmp-module

安装nginx-1.5.1

tar fvxz nginx-1.5.1.tar.gz

cd nginx-1.5.1

编译

./configure --prefix=/usr/local/nginx --with-http_stub_status_module  --with-http_gzip_static_module--with-http_ssl_module --with-zlib=/zkx/zlib-1.2.3 --with-pcre=/zkx/pcre-8.33--user=www --group=www --with-http_sub_module --with-http_flv_module--add-module=/zkx/nginx_mod_h264_streaming-2.2.7 --with-http_dav_module--with-http_addition_module --add-module=/zkx/nginx-accesskey-2.0.3--add-module=/zkx/nginx-rtmp-module/

make && make install

将视频和html页面放到指定路径下

/usr/local/nginx/vod/flvs

打开nginx配置文件进行配置

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

配置server段

 server {

      listen      80;

      server_name  localhost;

      #charset koi8-r;

      #access_log logs/host.access.log  main;

      location ~* \.(gif|jpg|jpeg|png|bmp|swf|ico|html|js|as)$ {

          root  /usr/local/nginx/vod/flvs;

      #    index  index.html index.htm;

    expires 30d;

 }

      location ~* \.(flv|mp4)$ {

        root /usr/local/nginx/vod/flvs;

        expires 1h;

      }

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档