编译 nginx + http-flv 模块

编译 nginx + http-flv 模块

一、源码准备

注意:Windows下下载.zip文件,Linux下下载.tar.gz文件,之前出现过.zip解压后pcre编译不过的情况

1、下载nginx 官网 github

2、下载PCRE 官网 github

3、下载zlib 官网 github

4、下载OpenSSL 官网 github

5、下载nginx-http-flv-module github

二、Windows 编译环境准备

1、下载安装MSYS2 官网

2、下载安装Strawberry Perl 官网

三、开始编译

1、将第一步下载的源代码解压,目录结构为

xxx代表是版本号

nginx-xxx  
nginx-http-flv-module-xxx  
openssl-xxx  
pcre-xxx  
zlib-xxx  

Linux下编译

1、cd到nginx目录,执行
auto/configure \
--with-cc=gcc \
--with-debug \
--with-stream \
--with-http_ssl_module \
--with-cc-opt=-DFD_SETSIZE=1024 \
--with-zlib=../zlib-1.2.13 \
--with-pcre=../pcre2-10.40 \
--with-openssl=../openssl-openssl-3.0.6 \
--with-openssl-opt=no-asm \
--prefix=../nginx \
--sbin-path=nginx \
--conf-path=conf/nginx.conf \
--pid-path=logs/nginx.pid \
--http-log-path=logs/access.log \
--error-log-path=logs/error.log \
--http-client-body-temp-path=temp/client_body_temp \
--http-proxy-temp-path=temp/proxy_temp \
--http-fastcgi-temp-path=temp/fastcgi_temp \
--http-scgi-temp-path=temp/scgi_temp \
--http-uwsgi-temp-path=temp/uwsgi_temp \
--add-module=../nginx-http-flv-module-1.2.10
2、再执行
make install

Windows 下编译

1、打开MSYS2 MSYS
2、cd到nginx目录
3、执行configure进行配置,注意目录是否正确
auto/configure \
--with-cc=cl \
--with-debug \
--with-stream \
--with-http_ssl_module \
--with-cc-opt=-DFD_SETSIZE=1024 \
--with-pcre=../pcre2-10.40 \
--with-zlib=../zlib-1.2.13 \
--with-openssl=../openssl-openssl-3.0.6 \
--with-openssl-opt=no-asm \
--prefix=E:/nginx \
--sbin-path=nginx.exe \
--conf-path=conf/nginx.conf \
--pid-path=logs/nginx.pid \
--http-log-path=logs/access.log \
--error-log-path=logs/error.log \
--http-client-body-temp-path=temp/client_body_temp \
--http-proxy-temp-path=temp/proxy_temp \
--http-fastcgi-temp-path=temp/fastcgi_temp \
--http-scgi-temp-path=temp/scgi_temp \
--http-uwsgi-temp-path=temp/uwsgi_temp \
--add-module=../nginx-http-flv-module-1.2.10
4、打开"x86 Native Tools Command Prompt for VS 2017"
中文翻译应该是"适用于 VS 2017 的 x86 本机工具命令提示"
5、cd到nginx目录
6、执行nmake

编译出来的nginx.exe在\nginx-release-1.21.1\objs目录下。

最后感谢博主@silent_missile的文章windows编译64位nginx

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值