标签:
转子: 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
或者手动编译:
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 的编译脚本
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 了
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 --prefix=/usr/local/tengine-2.1.0 --dso-path=/usr/local/tengine-2.1.0/modules --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_concat_module --with-http_lua_module --http-proxy-temp-path=/var/tmp/tengine-2.1.0/proxy_temp --http-fastcgi-temp-path=/var/tmp/tengine-2.1.0/fastcgi_temp --http-uwsgi-temp-path=/var/tmp/tengine-2.1.0/uwsgi_temp --http-scgi-temp-path=/var/tmp/tengine-2.1.0/cgi_temp --http-client-body-temp-path=/var/tmp/tengine-2.1.0/client_body_temp --http-log-path=/var/log/tengine-2.1.0/access.log --error-log-path=/var/log/tengine-2.1.0/error.log --with-ld-opt="-Wl,-rpath,$LUAJIT_LIB" make && make install useradd www ln -s /usr/local/tengine-2.1.0 /usr/local/nginx mkdir /var/tmp/tengine-2.1.0/client_body_temp -p chown -R www /var/tmp/tengine-2.1.0
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
标签:
原文地址:http://www.cnblogs.com/cmsd/p/4689850.html