标签:
参考:http://my.oschina.net/eduosi/blog/169606
安装 readline,lua 编译需要用到这个,centos 可以通过 yum 直接安装,如果不需要系统的,可以编译安装
yum install readline yum install readline-devel
或者手动编译:
cd /usr/local/src wget -c ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz tar -zxvf readline-6.2.tar.gz cd readline-6.2 ./configure make && make installl
手动编译后如果指定了 prefix ,要修改一下 lua 的编译脚本
cd /usr/local/src wget http://www.lua.org/ftp/lua-5.3.0.tar.gz tar zxvf lua-5.3.0.tar.gz cd lua-5.3.0 make linux make install cd .. wget http://luajit.org/download/LuaJIT-2.0.3.tar.gz tar zxvf LuaJIT-2.0.3.tar.gz cd LuaJIT-2.0.3 make make install ln -s /usr/local/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2 export LUAJIT_LIB=/usr/local/lib export LUAJIT_INC=/usr/local/include/luajit-2.0/ cd ..
接下来就可以编译 tengine 了
yum install -y pcre-devel pcre cd /usr/local/src wget http://tengine.taobao.org/download/tengine-2.1.0.tar.gz tar zxvf tengine-2.1.0.tar.gz cd tengine-2.1.0 ./configure --prefix=/usr/local/nginx --dso-path=/usr/local/nginx/modules --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_concat_module --with-http_lua_module --with-ld-opt="-Wl,-rpath,$LUAJIT_LIB" make && make install
test:
location /lua { # MIME type determined by default_type: default_type ‘text/plain‘; content_by_lua "ngx.say(‘Hello World Lua!‘)"; }
service nginx restart 或/usr/local/nginx/sbin/nginx -s reload
访问:http://localhost/lua 出现Hello World Lua说明安装成功了
标签:
原文地址:http://my.oschina.net/boltwu/blog/491765