[openresty] 其他的第三方模块如何与openresty集成?

194 views
Skip to first unread message

蒋子俊

unread,
May 14, 2012, 3:39:21 AM5/14/12
to openresty
请问,如何将HttpUpstreamConsistentHash之类的第三方模块整合进openresty一起编译?有没有较方便的办法,如不改openresty的configure文件?

直接在openresty下面的nginx部分用--add-module=则遇到了找不到lua-jit的问题。

谢谢!

http://wiki.nginx.org/HttpUpstreamConsistentHash 

--
Jackie

agentzh

unread,
May 14, 2012, 3:42:38 AM5/14/12
to open...@googlegroups.com
On Mon, May 14, 2012 at 3:39 PM, 蒋子俊 <jzj.j...@gmail.com> wrote:
> 请问,如何将HttpUpstreamConsistentHash之类的第三方模块整合进openresty一起编译?有没有较方便的办法,如不改openresty的configure文件?
>
> 直接在openresty下面的nginx部分用--add-module=则遇到了找不到lua-jit的问题。
>

ngx_openresty 自己的 ./configure 脚本支持所有 nginx 的 ./configure 脚本选项:

$ ./configure --help|grep add-module
--add-module=PATH enable an external module

事实上,所有 ngx_openresty 的 ./configure 脚本不认识的选项都会自动传递给 nginx 的 ./configure 脚本。

如果你同时需要给 nginx 核心或者其他组件打补丁的话,可以直接修改 bundle/
目录下的对应的源码。修改完之后,还是需要在顶层目录上执行正常的 ./configure && make && make install
的安装步骤。

Regards,
-agentzh

蒋子俊

unread,
May 14, 2012, 3:43:47 AM5/14/12
to open...@googlegroups.com
谢谢春哥。:-)

2012/5/14 agentzh <age...@gmail.com>



--
Jackie

Wendal Chen

unread,
May 14, 2012, 5:53:03 AM5/14/12
to open...@googlegroups.com
那些lua-resty-*模块呢? 只能自己cp过去吗?
Wendal Chen
GuangDong China

agentzh

unread,
May 14, 2012, 8:36:38 AM5/14/12
to open...@googlegroups.com
2012/5/14 Wendal Chen <wenda...@gmail.com>:
> 那些lua-resty-*模块呢? 只能自己cp过去吗?
>

我编写的 lua-resty-* 模块已默认包含在了 ngx_openresty 中,见组件列表清单:

http://openresty.org/#Components

如果你需要安装自己的 Lua 模块,直接安装进系统中,或者安装到 /usr/local/openresty/lualib/
下。当然也安装到其他任意位置上,但需要同时配置好 lua_package_path 和 lua_package_cpath 指令 :)

Regards,
-agentzh

Reply all
Reply to author
Forward
0 new messages