一、源码包获取

[root@Bookmark1 tmp]# wget http://agentzh.org/misc/nginx/ngx_openresty-1.2.1.14.tar.gz

二、安装

[root@Bookmark1 tmp]# tar -zxvf ngx_openresty-1.2.1.14.tar.gz

[root@Bookmark1 tmp]# cd ngx_openresty-1.2.1.14

[root@Bookmark1 ngx_openresty-1.2.1.14]#  ./configure  --prefix=/usr/local/ngx_openresty --with-luajit --with-http_stub_status_module

make时报错如下:

al/ngx_openresty/luajit/lib -lluajit-5.1 -lm -lpcre -lssl -lcrypto -ldl -lz
objs/src/event/ngx_event_openssl.o: In function `ngx_ssl_ecdh_curve':
ngx_event_openssl.c:(.text+0xace): undefined reference to `EC_KEY_new_by_curve_name'
ngx_event_openssl.c:(.text+0xb4d): undefined reference to `EC_KEY_free'
objs/src/http/ngx_http_request.o: In function `ngx_http_ssl_servername':
ngx_http_request.c:(.text+0xcfe): undefined reference to `SSL_get_servername'
ngx_http_request.c:(.text+0xe06): undefined reference to `SSL_set_SSL_CTX'
collect2: ld 返回 1
make[2]: *** [objs/nginx] 错误 1
make[2]: Leaving directory `/tmp/ngx_openresty-1.2.1.14/build/nginx-1.2.1'
make[1]: *** [build] 错误 2
make[1]: Leaving directory `/tmp/ngx_openresty-1.2.1.14/build/nginx-1.2.1'
make: *** [all] 错误 2

解决:

[root@Bookmark1 ngx_openresty-1.2.1.14]#  ./configure  --prefix=/usr/local/ngx_openresty  --with-http_ssl_module --with-luajit --with-http_stub_status_module --with-openssl=/opt/distfiles/openssl-0.9.8k(openssl的源码包的地址,不是安装路径)