win8.1下vs2013编译nginx
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了win8.1下vs2013编译nginx,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2001字,纯文字阅读大概需要3分钟。
内容图文
我的环境是win8.1 + vs2013社区版1、安装msys。
http://sourceforge.net/projects/mingw/files/ Installer文件夹下有mingw-get,安装之后,弹出的界面中选择msys即可安装msys。
2、下载 zlib、openssl和pcre
下的几个版本为:openssl-1.0.1j、pcre-8.32、zlib-1.2.8
解压到 $(NGINX_SOURCE)\objs\lib 目录,这个$(NGINX_SOURCE)为nginx源码放置路径,例如D:\Tools\nginx。
3、生成makefile
a) 启动vs 2013命令行。 通过vs 2013工具命令行启动msys,能省略配置cl路径的步骤。
b) 在上述命令行中启动msys。
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>cd /d C:\MinGW\msys\1.0 C:\MinGW\msys\1.0>msys.batc) 在msys控制台窗口中,运行配置脚本
$ cd /d/Tools/nginx/ $ 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.32 --with-zlib=objs/lib/zlib-1.2.8 --with-openssl=objs/lib/openssl-1.0.1j --with-select_module --with-http_ssl_module --with-ipv6
如果不想下载zlib(gzip模块需要)、pcre(rewrite模块需要)和openssl,可以修改一下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-select_module --without-http_rewrite_module --without-http_gzip_module
4、启动编译。
在编译之前,需要修改一下makefile,去掉CFLAGS中的-WX编译选项,否则vs2013会把警告当错误终止编译。
cd D:\Tools\nginxnmake -f objs\Makefile
5、运行nginx。
a) 把objs\nginx.exe拷贝到上一级目录。
b) 创建文件夹logs、temp
c) 启动nginx.exe
以上就介绍了win8.1下vs2013编译nginx,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
内容总结
以上是互联网集市为您收集整理的win8.1下vs2013编译nginx全部内容,希望文章能够帮你解决win8.1下vs2013编译nginx所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。