osx ei capitan 10.11.1 (15B42) make nginx1.9.5报错

leeyi 发布于 2015/10/25 18:37
阅读 934
收藏 0

我的系统是:osx ei capitan 10.11.1 (15B42)

从nginx官方网站下载 nginx-1.9.5.tar.gz

tar xzf nginx-1.9.5.tar.gz

cd nginx-1.9.5

./configure --prefix=/usr/local/nginx --without-http_rewrite_module --with-http_ssl_module


objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \

objs/src/http/modules/ngx_http_upstream_least_conn_module.o \

objs/src/http/modules/ngx_http_upstream_keepalive_module.o \

objs/src/http/modules/ngx_http_upstream_zone_module.o \

objs/ngx_modules.o \

-lssl -lcrypto -lz

Undefined symbols for architecture x86_64:

  "_SSL_CTX_set_alpn_select_cb", referenced from:

      _ngx_http_ssl_merge_srv_conf in ngx_http_ssl_module.o

  "_SSL_CTX_set_next_protos_advertised_cb", referenced from:

      _ngx_http_ssl_merge_srv_conf in ngx_http_ssl_module.o

  "_SSL_select_next_proto", referenced from:

      _ngx_http_ssl_alpn_select in ngx_http_ssl_module.o

  "_X509_check_host", referenced from:

      _ngx_ssl_check_host in ngx_event_openssl.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[1]: *** [objs/nginx] Error 1

make: *** [build] Error 2

Downloads/nginx-1.9.5 » 

不带 --without-http_rewrite_module --with-http_ssl_module 可以安装成功,但我我需要支持https

求高手指点 ?

加载中
0
无名码农
无名码农

用--with-cc-opt和--with-ld-opt指定openssl头文件和库文件的路径

又或者用--with-openssl=/the/path/to/openssl/source/code/指定openssl源代码的路径

leeyi
leeyi
回复 @无名码农 : 非常感谢啊,弄好了
无名码农
无名码农
回复 @leeyi : set是ngx_http_rewrite_module提供的指令
无名码农
无名码农
回复 @leeyi : 去掉--without-http_rewrite_module
leeyi
leeyi
make 通过了,但是 nginx -t 报错: [emerg] 12964#0: unknown directive "set" in /usr/local/nginx/conf/nginx.conf:71
leeyi
leeyi
参考 nginx.org/en/docs/configure.html ./configure --prefix=/usr/local/nginx --without-http_rewrite_module --with-http_ssl_module --with-cc-opt="-I /usr/local/include" --with-ld-opt="-L /usr/local/lib"
下一页
0
leeyi
leeyi
下载了最新版本openssl 解压之后指定到了--with-openssl= 包其他错误
0
leeyi
leeyi

我本地 openssl 只用brew安装的最新版本 

/usr/local/Cellar/openssl/1.0.2d_1

make之后还是报错,步骤和错误如下:

tar xzf nginx-1.9.5.tar.gz

cd nginx-1.9.5

./configure --prefix=/usr/local/nginx --without-http_rewrite_module --with-http_ssl_module --with-openssl=/Users/leeyi/Downloads/openssl-1.0.2d

"_i2d_SSL_SESSION", referenced from:

      _ngx_ssl_new_session in ngx_event_openssl.o

      _ngx_http_upstream_save_round_robin_peer_session in ngx_http_upstream_round_robin.o

  "_sk_num", referenced from:

      _ngx_ssl_session_cache in ngx_event_openssl.o

      _ngx_ssl_stapling in ngx_event_openssl_stapling.o

  "_sk_value", referenced from:

      _ngx_ssl_session_cache in ngx_event_openssl.o

      _ngx_ssl_stapling in ngx_event_openssl_stapling.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[1]: *** [objs/nginx] Error 1

make: *** [build] Error 2

0
张金富
张金富

看评价很多说升级了之后变卡 功能不好用的

看了下自己的版本 还是10.10.5 还好

返回顶部
顶部