nginx install lua module

#install luajit
#http://luajit.org/download.html

tar xzvf LuaJIT-2.0.4.tar.gz
cd LuaJIT-2.0.4
make install PREFIX=/home/allen.mh/local/luajit
sudo echo "/home/allen.mh/local/luajit/lib" > /etc/ld.so.conf.d/usr_local_luajit_lib.conf

#update bash_profile
export LUAJIT_LIB=/home/allen.mh/local/luajit/lib
export LUAJIT_INC=/home/allen.mh/local/luajit/include/luajit-2.0 

#download nginx module
#lua_nginx_module
http://github.com/chaoslawful/lua-nginx-module/tags
#ngx_devel_kit
https://github.com/simpl/ngx_devel_kit/tags

#install nginx 
#如果已经安装了,在源码包里重新编译即可
./configure --prefix=/home/allen.mh/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_rea
lip_module --with-pcre=/home/allen.mh/soft/pcre-8.36 --add-module=/home/allen.mh/soft/lua/ngx_devel_kit-0.2.19 --add-module=/home/allen.mh/soft/lua/lua-nginx-module-0.9.17r
c1 --add-module=/home/allen.mh/soft/lua/rds-json-nginx-module-0.13 --add-module=/home/allen.mh/soft/lua/redis2-nginx-module-master --add-module=/home/allen.mh/soft/lua/echo
-nginx-module-0.57 --with-debug

#已经安装了nginx的
sbin/nginx -s stop

make

make install

     location /hello {
            default_type 'text/plain'; 
            content_by_lua 'ngx.say("hello, lua")';                                                                                                                          
        }
#127.0.0.1:8000/hello
#如果输出: hello,lua
#install success

 

posted @ 2015-10-21 13:56  hao.ma  阅读(252)  评论(0编辑  收藏  举报