OpenRest添加不了nginx模块

问答中心分类: NginxOpenRest添加不了nginx模块
AFR 提问 7月 前

首先OpenResty是纯净状态我没有任何改动
我想为其中Nginx增加一个ngx_cache_purge模块
以下是我编译的过程,Y大看一下是否有错误
第一次,直接在openresty-1.11.2.3这个文件夹里面编译
cd /root/oneinstack/src/openresty-1.11.2.3/build/
wget http://labs.frickle.com/files/ngx_cache_purge2.3.tar.gz
cd ..
输入nginx -V返回如需编译情况
–prefix=/usr/local/openresty/nginx –with-cc-opt=-O2 –add-module=../ngx_devel_kit-0.3.0 –add-module=../echo-nginx-module-0.60 –add-module=../xss-nginx-module-0.05 –add-module=../ngx_coolkit-0.2rc3 –add-module=../set-misc-nginx-module-0.31 –add-module=../form-input-nginx-module-0.12 –add-module=../encrypted-session-nginx-module-0.06 –add-module=../srcache-nginx-module-0.31 –add-module=../ngx_lua-0.10.8 –add-module=../ngx_lua_upstream-0.06 –add-module=../headers-more-nginx-module-0.32 –add-module=../array-var-nginx-module-0.05 –add-module=../memc-nginx-module-0.18 –add-module=../redis2-nginx-module-0.14 –add-module=../redis-nginx-module-0.3.7 –add-module=../rds-json-nginx-module-0.14 –add-module=../rds-csv-nginx-module-0.07 –with-ld-opt=’-Wl,-rpath,/usr/local/openresty/luajit/lib -ljemalloc’ –user=www –group=www –with-http_stub_status_module –with-http_v2_module –with-http_ssl_module –with-http_gzip_static_module –with-http_realip_module –with-http_flv_module –with-http_mp4_module –with-openssl=/root/oneinstack/src/openresty-1.11.2.3/../openssl-1.0.2k –with-pcre=/root/oneinstack/src/openresty-1.11.2.3/../pcre-8.40 –with-pcre-jit
—————————————-分割线————————————————–
所以进行如需下编译,添加ngx_cache_purge2.3模块
./configure –prefix=/usr/local/openresty/nginx –with-cc-opt=-O2 –add-module=../ngx_devel_kit-0.3.0 –add-module=../echo-nginx-module-0.60 –add-module=../xss-nginx-module-0.05 –add-module=../ngx_coolkit-0.2rc3 –add-module=../set-misc-nginx-module-0.31 –add-module=../form-input-nginx-module-0.12 –add-module=../encrypted-session-nginx-module-0.06 –add-module=../srcache-nginx-module-0.31 –add-module=../ngx_lua-0.10.8 –add-module=../ngx_lua_upstream-0.06 –add-module=../headers-more-nginx-module-0.32 –add-module=../array-var-nginx-module-0.05 –add-module=../memc-nginx-module-0.18 –add-module=../redis2-nginx-module-0.14 –add-module=../redis-nginx-module-0.3.7 –add-module=../rds-json-nginx-module-0.14 –add-module=../rds-csv-nginx-module-0.07 –with-ld-opt=’-Wl,-rpath,/usr/local/openresty/luajit/lib -ljemalloc’ –user=www –group=www –with-http_stub_status_module –with-http_v2_module –with-http_ssl_module –with-http_gzip_static_module –with-http_realip_module –with-http_flv_module –with-http_mp4_module –with-openssl=/root/oneinstack/src/openresty-1.11.2.3/../openssl-1.0.2k –with-pcre=/root/oneinstack/src/openresty-1.11.2.3/../pcre-8.40 –with-pcre-jit –add-module=../ngx_cache_purge-2.3
最后出现错误提示:
./configure: error: no /root/oneinstack/src/openresty-1.11.2.3/../ngx_devel_kit-0.3.0/config was found
ERROR: failed to run command: sh ./configure –prefix=/usr/local/openresty/nginx/nginx \…
没有继续make
结束
———————-分割线—————————–
第二次我是在nginx-1.11.2文件夹下编译的
cd /root/oneinstack/src/openresty-1.11.2.3/build/nginx-1.11.2
./configure –prefix=/usr/local/openresty/nginx –with-cc-opt=-O2 –add-module=../ngx_devel_kit-0.3.0 –add-module=../echo-nginx-module-0.60 –add-module=../xss-nginx-module-0.05 –add-module=../ngx_coolkit-0.2rc3 –add-module=../set-misc-nginx-module-0.31 –add-module=../form-input-nginx-module-0.12 –add-module=../encrypted-session-nginx-module-0.06 –add-module=../srcache-nginx-module-0.31 –add-module=../ngx_lua-0.10.8 –add-module=../ngx_lua_upstream-0.06 –add-module=../headers-more-nginx-module-0.32 –add-module=../array-var-nginx-module-0.05 –add-module=../memc-nginx-module-0.18 –add-module=../redis2-nginx-module-0.14 –add-module=../redis-nginx-module-0.3.7 –add-module=../rds-json-nginx-module-0.14 –add-module=../rds-csv-nginx-module-0.07 –with-ld-opt=’-Wl,-rpath,/usr/local/openresty/luajit/lib -ljemalloc’ –user=www –group=www –with-http_stub_status_module –with-http_v2_module –with-http_ssl_module –with-http_gzip_static_module –with-http_realip_module –with-http_flv_module –with-http_mp4_module –with-openssl=/root/oneinstack/src/openresty-1.11.2.3/../openssl-1.0.2k –with-pcre=/root/oneinstack/src/openresty-1.11.2.3/../pcre-8.40 –with-pcre-jit –add-module=../ngx_cache_purge-2.3
返回错误代码:
adding module in ../ngx_lua-0.10.8
checking for Lua library … not found
checking for Lua library in /usr/local/ … not found
checking for Lua library in /usr/local/ … not found
checking for Lua library in /usr/pkg/ … not found
checking for Lua library in /opt/local/ … not found
checking for Lua library in /usr/local/*/lua51/ … not found
checking for Lua library in /usr/ … not found
checking for LuaJIT library in /usr/local/ … not found
checking for LuaJIT library in /usr/ … not found
checking for LuaJIT library in /usr/ … not found
 ./configure: error: ngx_http_lua_module requires the Lua library.
找不到lua模块
求解。
 
 
 

7 问题
最佳答案
oneinstack 回答 7月 前
  1. 安装前可以修改options.conf 添加–add-module=../ngx_cache_purge-2.3
  2. 源码自己编译,openresty不要用nginx -V后面参数。参数如下:
    . ./versions.txt
    . ./options.conf
    ./configure --prefix=$openresty_install_dir --user=$run_user --group=$run_user --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-ld-opt='-ljemalloc' --add-module=../ngx_cache_purge-2.3

 

cc 回答 7月 前

我前几天 编译也是搞不成功。。郁闷了。
=下去试试看。
修改options.conf 添加–add-module=../ngx_cache_purge-2.3
这个在那里添加? options.conf 最后一行吗?
 

cc 回答 7月 前

# Add modules
nginx_modules_options=” 
php_modules_options=”  
# Add modules
nginx_modules_options=’../ngx_cache_purge-2.3′
php_modules_options=”
是 这里吧。 这样对吗?

cc 回答 6月 前

如果我要一次添加几个模块。 那这段里面怎么写?
nginx_modules_options=’../ngx_cache_purge-2.3′
nginx_modules_options=’../ngx_cache_purge-2.3′ 空格 ’../ngx_cache_purge-2.3′
还是怎么来写。

oneinstack 回答 6月 前
nginx_modules_options='--add-module=../ngx_cache_purge-2.3'
cc 回答 6月 前

我的意思是 还要添加一个模块。 就是2个模块一起编译 或者多个模块一起编译 这段话  要怎么写

oneinstack 回答 6月 前

这个很难理解吗?

nginx_modules_options='--add-module=../ngx_cache_purge-2.3 --add-module=../others_module'