NGINX 添加MP4、FLV视频支持模块

简介: 由于公司网站需要放置视频,但是默认的服务器环境是没有编译这个支持的模块,视频文件只能缓冲完了在播放,非常麻烦。   之前呢也安装了一个nginx_mod_h264_streaming来支持,效果很不错,但是服务器最近系统更新后出了点问题,只好从新编译,今天在nginx官网看到了nginx在新版本中已经支持了--with-http_mp4_module --with-http_flv_module这2个模块。

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

 
之前呢也安装了一个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
目录
相关文章
|
1月前
|
应用服务中间件 nginx
Nginx安装nginx-rtmp-module模块
【2月更文挑战第4天】 nginx中的模块虽然就是类似插件的概念,但是它无法像VsCode那样轻松的安装扩展。 nginx要安装其它模块必须同时拿到nginx源代码和模块源代码,然后手动编译,将模块打到nginx中,最终生成一个名为nginx的可执行文件。
71 6
|
3月前
|
应用服务中间件 nginx
百度搜索:蓝易云【利用nginx内置ngx_http_mirror_module模块实现流量复制及流量放大】
以上就是使用Nginx内置 `ngx_http_mirror_module`模块实现流量复制和流量放大的简要示例。通过合理配置和利用该模块,可以实现更复杂的流量控制和调试需求。
55 1
|
2月前
|
消息中间件 关系型数据库 MySQL
使用Nginx的stream模块实现MySQL反向代理与RabbitMQ负载均衡
使用Nginx的stream模块实现MySQL反向代理与RabbitMQ负载均衡
60 0
|
3月前
|
存储 应用服务中间件 nginx
Nginx模块开发:handler模块实现
Nginx模块开发:handler模块实现
27 0
|
3月前
|
存储 应用服务中间件 nginx
Nginx模块开发:模块结构的源码阅读以及过滤器(Filter)模块的实现
Nginx模块开发:模块结构的源码阅读以及过滤器(Filter)模块的实现
64 0
|
3月前
|
存储 应用服务中间件 nginx
Nginx:过滤模块的实现
Nginx:过滤模块的实现
|
3月前
|
存储 负载均衡 网络协议
Nginx: handler 模块的实现
Nginx: handler 模块的实现
|
3月前
|
前端开发 应用服务中间件 nginx
nginx过滤器模块
nginx过滤器模块
|
3月前
|
应用服务中间件 nginx
nginx日志模块 ngx_http_log_module
nginx日志模块 ngx_http_log_module
|
5月前
|
应用服务中间件 nginx
nginx中handle模块的编写小案例
nginx中handle模块的编写小案例
nginx中handle模块的编写小案例