windows10 vs2015编译 带nginx-rtmp-module 模块的32位nginx
1 下载必要软件
从 http://xhmikosr.1f0.de/tools/msys/下载msys:http://xhmikosr.1f0.de/tools/msys/MSYS_MinGW-w64_GCC_610_x86-x64_Full.7z。
把MSYS_MinGW-w64_GCC_610_x86-x64_Full.7z压缩包里面的MSYS解压到C盘根目录。
安装windwos版本git。https://git-for-windows.github.io/
https://github.com/git-for-windows/git/releases/download/v2.9.3.windows.1/Git-2.9.3-64-bit.exe
vc2015下载地址:https://www.visualstudio.com/downloads/download-visual-studio-vs
安装perl
http://www.activestate.com/activeperl/downloads
http://www.activestate.com/activeperl/downloads/thank-you?dl=http://downloads.activestate.com/ActivePerl/releases/5.24.0.2400/ActivePerl-5.24.0.2400-MSWin32-x86-64int-300560.exe
安装hg代码管理工具,下载nginx源码。需要设置环境变量PATH 加入 C:\Program Files\Mercurial。
https://www.mercurial-scm.org/release/windows/Mercurial-3.9-x64.exe
2 下载编译nginx必须的源码包
cmd.exe
d:
cd d:\git\
hg clone http://hg.nginx.org/nginx
cd nginx
hg tags 找到最新tag是release-1.11.3
迁出最新稳定版本代码
hg co release-1.11.3
# 修改错误级别为3级,d:\git\nginx\auto\cc\msvc的83行,把 -W4 修改为 -W3
# 否则,编译时(nmake -f build/Makefile),会出现如下错误:
# build/lib/nginx-rtmp-module/ngx_rtmp_core_module.c(611): error C2220: 警告被视为错误 - 没有生成“object”文件
# build/lib/nginx-rtmp-module/ngx_rtmp_core_module.c(611): warning C4456: “sa”的声明隐藏了上一个本地声明
# build/lib/nginx-rtmp-module/ngx_rtmp_core_module.c(611): note: 要简化迁移,请考虑暂时对用于生成且不引发警告的编译器版本 使用 /Wv:18 标记
# build/lib/nginx-rtmp-module/ngx_rtmp_core_module.c(506): note: 参见“sa”的声明
# NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"”: 返回代码“0x2”
# Stop.
d:\git\nginx\auto\cc\msvc
CFLAGS="$CFLAGS -W4" ==> CFLAGS="$CFLAGS -W3"
mkdir build
mkdir build\lib
# 下载 nginx-rtmp-module 代码,checkout稳定版本
git clone https://github.com/arut/nginx-rtmp-module.git
cd nginx-rtmp-module
git tag
git checkout -b b1.1.9 v1.1.9
# 打开 msys 环境,下载必要的源码包。
c:\msys\msys.bat
在msys窗口输入:
cd d:/git/nginx/build/lib/
# 下载 opensll、pcre、zlib到lib目录,并解压
wget ftp://ftp.openssl.org/source/old/1.0.1/openssl-1.0.1s.tar.gz
wget http://downloads.sourceforge.net/pcre/pcre-8.39.tar.bz2
wget http://zlib.net/zlib-1.2.8.tar.gz
tar -xzf openssl-1.0.1s.tar.gz
tar -jxvf pcre-8.39.tar.bz2
tar -xzf zlib-1.2.8.tar.gz
3 编译
cd d:/git/nginx
# 在msys的/d/git/nginx目录下执行 auto/configure如下:
auto/configure --with-cc=cl --builddir=build --prefix= \
--conf-path=conf/nginx.conf --pid-path=logs/nginx.pid \
--http-log-path=logs/access.log --error-log-path=logs/error.log \
--sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp \
--http-proxy-temp-path=temp/proxy_temp \
--http-fastcgi-temp-path=temp/fastcgi_temp \
--with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=build/lib/pcre-8.39 \
--with-zlib=build/lib/zlib-1.2.8 --with-openssl=build/lib/openssl-1.0.1s \
--with-select_module --with-http_ssl_module --with-ipv6 \
--with-http_sub_module \
--add-module=build/lib/nginx-rtmp-module
在cmd窗口运行:
d:
cd d:/git/nginx
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
nmake -f build/Makefile
运行完成后,cmd 命令行窗口显示:
已完成库搜索
sed -e "s|%PREFIX%||" -e "s|%PID_PATH%|/logs/nginx.pid|" -e "s|%CONF_PATH%|/conf/nginx.conf|" -e "s|%ERROR_LOG_PATH%|/logs/error.log|" < docs/man/nginx.8 > build/nginx.8
'sed' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
NMAKE : fatal error U1077: “sed”: 返回代码“0x1”
Stop
这个是因为我们没有正确配置msys 和 mingw32 在windows 上面的路径产生的,不用理会。
在d:\git\nginx\build\下面,已经成功生成nginx.exe
4 配置
cd d:\git\nginx\build
mkdir logs
mkdir temp
# 修改 lib\nginx-rtmp-module\test\nginx.conf 的配置内容,指定 /path/to 为 lib
# 注意系统不要占用tcp 8080端口,和 1935 端口。nginx.conf 中默认使用了8080 作为http端口,1935 作为推流端口。
# root /path/to/nginx-rtmp-module/test;
root lib/nginx-rtmp-module/test;
# root /path/to/nginx-rtmp-module/test/www;
root lib/nginx-rtmp-module/test/www;
5 测试
# 启动nginx.exe
nginx.exe -c lib\nginx-rtmp-module\test\nginx.conf
在浏览器地址栏输入一下内容,如果pc上带有可用摄像头,就可以看到录制、观看视频流:
http://127.0.0.1:8080/index.html
http://127.0.0.1:8080/rtmp-publisher/player.html
http://127.0.0.1:8080/rtmp-publisher/publisher.html
http://127.0.0.1:8080/stat/
windows10 vs2015编译 带nginx-rtmp-module 模块的32位nginx的更多相关文章
- Aliyun OSS Nginx proxy module(阿里云OSS Nginx 签名代理模块)
1.此文章主要介绍内容 本文主要介绍如何利用Nginx lua 实现将阿里云OSS存储空间做到同本地磁盘一样使用.核心是利用Nginx lua 对OSS请求进行签名并利用内部跳转将所有访问本地Ngin ...
- ffmpeg,rtmpdump和nginx rtmp实现录屏,直播和录制
公司最近在做视频直播的项目,我这里分配到对直播的视频进行录制,录制的方式是通过rtmpdump对rtmp的视频流进行录制 前置的知识 ffmpeg: 用于实现把录屏工具发出的视频和音频流,转换成我们需 ...
- nginx upload module的使用
现在的网站,总会有一点与用户交互的功能,例如允许用户上传头像,上传照片,上传附件这类的.PHP写的程序,对于上传文件效率不是很高.幸好,nginx有一个名为upload的module可以解决这个问题. ...
- 开始Nginx的SSL模块
nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/n ...
- nginx健康检查模块源码分析
nginx健康检查模块 本文所说的nginx健康检查模块是指nginx_upstream_check_module模块.nginx_upstream_check_module模块是Taobao定制的用 ...
- nginx的ngx_http_geoip2模块以精准禁止特定地区IP访问
要求:对网站的信息,比如某个访问节点不想国内或者国外的用户使用,禁止国内或者国外或者精确到某个城市的那种情况. 解决方式:1.Cloudfalre来实现禁止特定国家的ip访问,比较简单,但是需要mon ...
- 【Nginx】如何为已安装的Nginx动态添加模块?看完我懂了!!
写在前面 很多时候,我们根据当时的项目情况和业务需求安装完Nginx后,后续随着业务的发展,往往会给安装好的Nginx添加其他的功能模块.在为Nginx添加功能模块时,要求Nginx不停机.这就涉及到 ...
- Win7 下用 VS2015 编译最新 openssl(1.0.2j)包含32、64位debug和release版本的dll、lib(8个版本)
Win7 64位系统下通过VS2015编译好的最新的OpenSSL(1.0.2j)所有八个版本的链接库, 包含以下八个版本: 1.32位.debug版LIB: 2.32位.release版LIB: 3 ...
- vs2015编译zlib静态库步骤
ZLIB静态库的编译 下载ZLIB源码 ZLib官网下载或者GitHub上直接 clone 下来即可 www.zlib.net 截至目前最新版本1.2.1.1本 如下图我选择从官网下载 下载完以后解压 ...
随机推荐
- Oracle11g创建表空间及用户
第1步:创建临时表空间 create temporary tablespace pgenius_temptempfile '/data/oracle/oradata/orcl/pgenius_te ...
- C#学习历程(三)[基础概念]
>>简单描述OOP 面向对象编程是由面向过程编程发展而来,不再注重于具体的步骤,而是更多的聚焦于对象. 以对象为载体,然后去完善对象的特点(属性),然后实现对象的具体的功能,同时处理对象与 ...
- 消除浏览器对input输入框的自动填充
Mozilla官方文档建议的是 直接使用 autocomplete = ‘off’ 即可禁止输入框从浏览器cache获取数据,博主以前使用这个也就足够兼容浏览器了. 现在发现,却在chrome.fir ...
- Appium 测试APK
介绍 Appium是一个开源.跨平台的测试框架,可以用来测试原生及混合的移动端应用.Appium支持iOS.Android及FirefoxOS平台测试.Appium使用WebDriver的json w ...
- Snap Impression (by quqi99)
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明 (http://blog.csdn.net/quqi99) Snap一是把应用隔离在沙盒之内,保证不同应用之间或 ...
- C#中正则表达式编程(未完,待补充)
对于只存储一个匹配,可用Match类: 一般模式: Regex reg = new Regex(string pattern); string str = "###############& ...
- iOS-----解决Prefix Header出错的问题
我们在使用 Prefix Header 预编译文件时有时会遇到如下的报错 clang: error: no such file or directory: '/Users/linus/Dropbox/ ...
- iPhone开机键坏了如何开机
作死 开机 [苹果手机/iphone开机键坏了怎么开机]
- javascript的slice()与splice()方法
(1)数组和String对象都有slice()方法. //Array var list = ['A','B','C','D','DS']; console.log(list.slice(,));//截 ...
- windows中的oracle12SE后启动的系统服务的列表
下图是我安装在windows 10下安装好oracle12.10SE之后的启动的系统服务的列表. 通常,我是将其全部修改为手动启动.当需要用oracle服务的时候,只需要启动对应的实例的服务和tnsl ...