首页 > 应用 > 软件技巧 > 正文

nginx 0.8.54/1.0.0 在cygwin环境下的编译(包括 nginx_mod_h264_streaming

2024-07-16 17:45:11
字体:
来源:转载
供稿:网友
    一、概述:
    由于测试需要在WIN平台上进行.264的MP4文件的拖动功能,而nginx windows官方版本不包含nginx_mod_h264_streaming-2.2.7模块,所以才有了本文。

    二、准备:
    1、cygwin http://www.cygwin.com/setup.exe

    复制代码代码如下:
    安装库
    gcc g++
    zlib 库 (gzip 模块需要)
    pcre 库 (rewrite 模块需要 )
    openssl库 (ssl模块需要)
    提示:国外下载库速度较慢,可以使用网易提供的开源站下载
    http://mirrors.163.com/cygwin/

    2、nginx 0.8.54 /1.0.0(在这里yaosansi以0.8.54版本为示例)

    复制代码代码如下:
    cd ~
    wget http://nginx.org/download/nginx-0.8.54.tar.gz
    wget http://nginx.org/download/nginx-1.0.0.tar.gz

    3、the H264 Streaming Module for Nginx (version 2)

    复制代码代码如下:
    cd ~
    wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz
    tar -zxvf nginx_mod_h264_streaming-2.2.7.tar.gz
    改动 ngx_http_h264_streaming_module.c,将以下内容全部移除或注释掉,否则会遇到 error: 'ngx_http_request_t' has no member named 'zero_in_uri'的错误提示
    /* TODO: Win32 */ if (r->zero_in_uri) { return NGX_DECLINED; }

    三、配置和编译Nginx
    1、.configure脚本

    复制代码代码如下:
    ./configure /
    --prefix=. /
    --sbin-path=nginx /
    --conf-path=conf/nginx.conf /
    --pid-path=logs/nginx.pid /
    --error-log-path=logs/error.log /
    --http-log-path=logs/access.log /
    --http-client-body-temp-path=client/ /
    --http-proxy-temp-path=proxy/ /
    --http-fastcgi-temp-path=fastcgi/ /
    --with-cc-opt="-D FD_SETSIZE=4096" /
    --with-debug /
    --with-mail_ssl_module /
    --with-http_realip_module /
    --with-http_stub_status_module /
    --with-http_ssl_module /
    --with-http_flv_module /
    --add-module=../nginx_mod_h264_streaming-2.2.7
    make && make install

    2、在编译过程中,注意事项:(引用 :http://www.tech126.com/cygwin-nginx/)
    1、prefix的选项,如果我们指定–prefix=/cygdrive/d/nginx,那么最后脱离Cygwin环境运行,会发现root无法指向其它磁盘上的目录,所以这里使用了相对路径,而且指定了可执行文件nginx在根目录下,而不是默认的sbin/nginx
    2、FD_SETSIZE=4096,网上都说了,是将select模式的最大worker_connections加大,如果不加此参数将可能出现以下的错误提示,
    [emerg] 2496#0: the maximum number of files supported by select() is 64的错误提示,这表示FD_SETSIZE的值比nginx配置文件中worker_connections指令所指定的值,你可以把nginx.conf里的worker_connections选项改小一些,比如44,加了–with-cc-opt=”-DFD_SETSIZE=4096”后就不会碰到这问题
    3、编译mod_passport之前,最好执行dos2unix.exe mod_passport/config转换一下格式
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表