博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
NGINX 添加MP4、FLV视频支持模块
阅读量:6887 次
发布时间:2019-06-27

本文共 2128 字,大约阅读时间需要 7 分钟。

由于公司网站需要放置视频,但是默认的服务器环境是没有编译这个支持的模块,视频文件只能缓冲完了在播放,非常麻烦。

 
之前呢也安装了一个nginx_mod_h264_streaming来支持,效果很不错,但是服务器最近系统更新后出了点问题,只好从新编译,今天在nginx官网看到了nginx在新版本中已经支持了--with-http_mp4_module --with-http_flv_module这2个模块。所以就来自己编译吧。
 
编译之前我们需要看看之前编译的参数,使用nginx -V查看得到如下参数
 
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
 
接下来就进入之前安装的目录,我用的是lnmp1.0的脚本安装的,文件地址在/root/lnmp1.0-full
 
当然我的nginx是我后来更新过的,版本是1.4.3,再次进入nginx-1.4.3这个目录
 
备份之前的程序配置
 
 
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
 
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_mp4_module --with-http_flv_module
等待结束,查看是否报错(应该不会报错,因为用的都是nginx默认支持的模块,不是外挂的)正常文件如
 
Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library
 
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
编译
 
 
make
nginx -t
如果提示如下命令就证明没有问题,就可以升级了
 
 
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
 
make install
 
nginx version: nginx/1.4.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_mp4_module --with-http_flv_module

转载地址:http://qxabl.baihongyu.com/

你可能感兴趣的文章
python中struct.unpack的用法
查看>>
体绘制(Volume Rendering)概述之4:光线投射算法(Ray Casting)实现流程和代码(基于CPU的实现)...
查看>>
Python实践之(七)逻辑回归(Logistic Regression)
查看>>
PAT (Advanced Level) 1107. Social Clusters (30)
查看>>
【开源社群系统研发日记五】ThinkSNS+ 是如何计算字符显示长度的
查看>>
Nodejs日志管理log4js
查看>>
python获取昨日日期
查看>>
海康威视 - 萤石云开放平台 js 版
查看>>
关于分销平台
查看>>
剑指offer---12-**--数值的整数次方
查看>>
PAT - L2-010. 排座位(并查集)
查看>>
Python 学习笔记 - 线程(线程锁,信标,事件和条件)
查看>>
大数据技术服务商个推获4亿人民币D轮融资
查看>>
Git的详细使用教程
查看>>
iOS实现类似苹果手机原生的锁屏界面(数字密码)
查看>>
[vue] 表单输入格式化,中文输入法异常
查看>>
Observer观察者模式与OCP开放-封闭原则
查看>>
如何搭建高级工程师知识框架?推荐两种方式
查看>>
BAT的医疗春秋大梦
查看>>
Pulsar本地单机(伪)集群 (裸机安装与docker方式安装) 2.2.0
查看>>