windows下编译nginx+nginx_rtmp_modue(vs2013)
阅读官方编译windows版本的方法 http://nginx.org/en/docs/howto_build_on_win32.html
我的环境 Windows 7 Ultimate 64,Visual Studio 2013
nginx_rtmp_modue 在nginx 1.7是无法编译(linux就不行),所以获取1.6的版本进行编译:
hg clone http://hg.nginx.org/nginx nginx-1.6 -u release-1.6.1 (必须在命令行下运行)
其他几个下载资源
pre http://ncu.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.zip
zlib http://cznic.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
openssl http://www.openssl.org/source/openssl-1.0.1e.tar.gz
nginx_rtmp_modue https://github.com/arut/nginx-rtmp-module
问题与解决
1,添加nginx_rtmp_module编译选项
auto/configure --with-cc=cl --builddir=objs --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=objs/lib/pcre-8.35 \
--with-zlib=objs/lib/zlib-1.2.8 --with-openssl=objs/lib/openssl-1.0.1e \
--with-select_module --with-http_ssl_module --with-ipv6 \
--add-module=../nginx-module/nginx-rtmp-module
2, auto/configure 命令需要在MSYS命令行下执行;
3, nmake -f objs/Makefile需要在vs 命令行执行,在c:\Program Files (x86)\Common7\Tools\Shortcuts 可以看到:
如果你需要编译64位的则选择x64的命令行工具;
3,当执行nmake -f objs/Makefile 时报错
从输出日志看,是编译openssl造成的,从错误信息看到: error C2220 “警告被视为错误”,这里只看到了warning C4996一个警告,所以问题必然出在这了,
那就给openssl加上编译选项忽略掉这个警告:--with-openssl-opt=-wd4996;
将configure命令改成:
auto/configure --with-cc=cl --builddir=objs --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=objs/lib/pcre-8.35 \
--with-zlib=objs/lib/zlib-1.2.8 --with-openssl=objs/lib/openssl-1.0.1e \
--with-select_module --with-http_ssl_module --with-ipv6 \
--with-openssl-opt=-wd4996 \
--add-module=../nginx-module/nginx-rtmp-module
修改后运行;
(以下方法更简单高效)
也可以直接修改nginx目录下的的objs/Makefile文件,找到这一行:
$(MAKE) -f auto/lib/openssl/makefile.msvcOPENSSL="../lib/openssl-0.9.8r"
然后修改为:
$(MAKE) -f auto/lib/openssl/makefile.msvcOPENSSL="../lib/openssl-0.9.8r" OPENSSL_OPT="-wd4996"
修改完后执行nmake -f objs/Makefile, done!
windows下编译nginx+nginx_rtmp_modue(vs2013)的更多相关文章
- Nginx (一)Windows下编译Nginx源码以及安装 nginx for windows方法步骤
转载自: http://apps.hi.baidu.com/share/detail/11192699#content Nginx介绍: Nginx ("engine x")是一个 ...
- windows下编译调试nginx
typora-copy-images-to: image windows下编译调试nginx linux使用gdb跟踪代码效率不高,在通过跟踪代码进行源码分析,与定位复杂逻辑问题时,如果有一个简单易用 ...
- Windows下编译OpenSSL(使用VS2013)
简述 OpenSSL是一个开源的第三方库,它实现了SSL(Secure SocketLayer)和TLS(Transport Layer Security)协议,被广泛企业应用所采用.对于一般的开发人 ...
- Windows下搭建Nginx图片服务器
在项目最开始,上传图片的时候,服务器先保存原图再使用ImageMagick生成上传图片缩略图,这种方法有很多缺点,例如生成的缩略图的大小是固定的,不能动态请求指定大小的缩略图. 虽然有非常多的图片云存 ...
- 在Windows下编译WebRTC
前言 这篇文章的目的在于为你节省生命中宝贵的10小时(甚至更多),或者浪费你10分钟.作为Google更新频繁的大型跨平台基础库,WebRTC的编译一直被人称为噩梦.如果恰巧你偏要在Windows下编 ...
- windows下编译配置libnet-1.2-rc3
1.下载winpcap(一个底层驱动,可以嗅探.过滤网卡数据包,发包).exe安装包,傻瓜一步式安装 2.下载WpdPack_4_1_2,这个是winpcap的开发者包,解压之后只需要配置相关路径. ...
- [转] Windows下编译OpenSSL
简述 OpenSSL是一个开源的第三方库,它实现了SSL(Secure SocketLayer)和TLS(Transport Layer Security)协议,被广泛企业应用所采用.对于一般的开发人 ...
- windows 下使用Nginx替代apache作为服务器
说实话, 在windows下使用Nginx 着实有点不太方便, 但因项目需求, 又不想换系统(虽然可以搞个虚拟机玩), 只能用Nginx了 好了, 不多说了. 开始... 首先我用的是xampp包(A ...
- windows下安装nginx
说起开发,自己感到非常惭愧,由于公司让我给<绿电侠>项目写整体架构解决方案,才开始接触nginx这个东东,突然觉得它是一把非常好的利器. 本文主要记录在windows下安装nginx,另参 ...
随机推荐
- 普通用户开通sudo权限:xxx is not in the sudoers file.This incident will be reported.的解决方法
1.切换到root用户下,怎么切换就不用说了吧,不会的自己百度去. 2.添加sudo文件的写权限,命令是: chmod u+w /etc/sudoers 3.编辑sudoers文件 vi /etc/s ...
- 通过Fegin远程调用 ,返回JPA Page 对象报错
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of org.sp ...
- LeetCode OJ:Swap Nodes in Pairs(成对交换节点)
Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2-&g ...
- LeetCode OJ:Longest Increasing Subsequence(最长递增序列)
Given an unsorted array of integers, find the length of longest increasing subsequence. For example, ...
- C++内存分配与对象构造的分离
在C++中,我们基本用new(delete)操作符分配(释放)内存.new操作符为特定类型分配内存,并在新分配的内存中构造该类型的一个对象.new表达式自动运行合适的构造函数来初始化每个动态分配的类类 ...
- MATLAB基础知识tips
网络论坛资源: MATLAB中文论坛https://i.cnblogs.com/EditPosts.aspx?opt=1 circshift 移位函数,circshift(A,SHIFTSIZE).S ...
- 一条命令修改Linux密码
方法一.直接使用passwd命令 /bin/echo newpass|/usr/bin/passwd --stdin username *注:该方式只适用于红帽系操作系统,比如centos,redha ...
- Linux系统在启动过程中grub引导文件丢失的解决方法
在/boot/grub2目录下有一个grub.cfg文件:该文件主要是用来自动地引导系统启动内核程序和系统的初始化程序. 问题一:当系统在启动的情况下,我们不小心删除/boot/grub2/grub. ...
- linux centos 安装opencv
系统:Centos 6.5 最后版本 OpenCV: 2.4.9 1.安装依赖包(很重要) yum install cmake gcc gcc-c++ gtk+-devel gimp-devel gi ...
- nginx and node.js配合使用 helloworld
nginx是最好的反向代理服务器. Node.js是... 好吧 ,不介绍了,猛击这里 现在小介绍下怎么用nginx和node.js配合使用. 先写个helloworld.js var http = ...