tengine安装lua

扫码查看

转子: http://www.cnblogs.com/shengshuai/p/4244851.html

参考: http://www.ttlsa.com/nginx/nginx-lua/

学习:http://jinnianshilongnian.iteye.com/blog/2186448

安装 readline,lua 编译需要用到这个,centos 可以通过 yum 直接安装,如果不需要系统的,可以编译安装

yum install readline
yum install readline-devel

或者手动编译:

tengine安装lua-LMLPHP
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
tengine安装lua-LMLPHP

手动编译后如果指定了 prefix ,要修改一下 lua 的编译脚本

修改lua src/Makefile
修改MYCFLAGS=-I/usr/local/readline/include
修改MYLDFLAGS=-L/usr/local/readline/lib
直接执行lua命令,出现加载不了readline.so的问题,软链接 /usr/local/readline/lib/libreadline.so.6 到 /usr/lib/
 
下面安装 lua

tengine安装lua-LMLPHP
wget http://www.lua.org/ftp/lua-5.3.0.tar.gz

tar xf 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 xf 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安装lua-LMLPHP

接下来就可以编译 tengine 了

tengine安装lua-LMLPHP
yum install -y pcre-devel pcre
wget http://tengine.taobao.org/download/tengine-2.1.0.tar.gz
tar xf tengine-2.1.0.tar.gz
cd tengine-2.1.0 ./configure --user=web --group=web --prefix=/data/server/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-pcre --with-http_lua_module --with-ld-opt="-Wl,-rpath,$LUAJIT_LIB" make && make install useradd web ln -s /data/server/nginx/sbin/nginx /usr/sbin/nginx
tengine安装lua-LMLPHP
 

test:

location /lua_content {
            # MIME type determined by default_type:
            default_type 'text/plain';

content_by_lua "ngx.say('Hello,world!')";
        }

base64

wget http://luaforge.net/frs/download.php/2664/luasocket-2.0.2.tar.gz

05-11 18:11
查看更多