给nginx装上lua扩展 发表于 2016-01-25 | 分类于 nginx lua openresty agentzh | 12345678910111213141516171819202122232425262728293031323334353637mkdir ngx-with-luacd ngx-with-luacurrent_dir=`pwd`# download luajitwget http://luajit.org/download/LuaJIT-2.0.4.tar.gztar -xf LuaJIT-2.0.4.tar.gzcd LuaJIT-2.0.4make && make install# download more set headers module for nginxwget https://github.com/openresty/headers-more-nginx-module/archive/v0.29.tar.gzmv v0.29.tar.gz nginx-more-set-headers-v0.29.tar.gztar -xf nginx-more-set-headers-v0.29.tar.gz# download nginx devel kitwget https://github.com/simpl/ngx_devel_kit/archive/v0.2.19.tar.gzmv v0.2.19.tar.gz nginx-devel-kit-v0.2.19.tar.gztar -xf nginx-devel-kit-v0.2.19.tar.gz# download lua module for nginxwget https://github.com/openresty/lua-nginx-module/archive/v0.10.0.tar.gzmv v0.10.0.tar.gz nginx-lua-v0.10.0.tar.gztar -xf nginx-lua-v0.10.0.tar.gz# download nginxwget http://nginx.org/download/nginx-1.9.9.tar.gztar -xf nginx-1.9.9.tar.gzexport LUAJIT_LIB=/usr/local/lib/libluajit-5.1.so.2.0.4export LUAJIT_INC=/usr/local/include/luajit-2.0/# compile nginxcd nginx-1.9.9./configure --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_mp4_module --with-http_secure_link_module --with-http_gzip_static_module --with-stream --with-stream_ssl_module --add-module=$current_dir/headers-more-nginx-module-0.29 --add-module=$current_dir/ngx_devel_kit-0.2.19 --add-module=$current_dir/lua-nginx-module-0.10.0 --with-ld-opt="-Wl,-rpath,/usr/local/lib"make make install