lua-nginx-module

一、下载luajit 2.0

http://luajit.org/download.html

二、下载nginx源代码

http://www.nginx.org/en/download.html

三、下载nginx_devel_kit

https://github.com/simpl/ngx_devel_kit/tags

四、下载lua-nginx-module

https://github.com/chaoslawful/lua-nginx-module/tags

五、先安装luajit

make & make install

六、设置环境变量:

export LUAJIT_LIB=/usr/local/lib

export LUAJIT_INC=/usr/local/include/luajit-2.0

七、安装nginx

./configure --with-http_stub_status_module --add-module=/mnt/hgfs/vmware/ngx_devel_kit-0.2.17rc2 --add-module=/mnt/hgfs/vmware/lua-nginx-module-0.7.5rc1

make -j2

make install

八、运行

报错误:

[root@localhost nginx]# sbin/nginx -v

sbin/nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory

解决:

echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf

/sbin/ldconfig