tengine-lua 安装

shell 脚本安装

#!/bin/bash
if [ ! -e /Data/apps ];then 
      mkdir /Data/apps -pv 
fi
if [ ! -e /opt/src ];then
    mkdir /opt/src
fi
cd /opt/src
#tengine
if [ ! -e /opt/src/tengine-2.2.0.tar.gz ];then
    wget http://tengine.taobao.org/download/tengine-2.2.0.tar.gz
    tar xf tengine-2.2.0.tar.gz
fi
#ngx_purge

if [ ! -e /opt/src/ngx_cache_purge-2.3.tar.gz ];then
    wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz
    tar xf ngx_cache_purge-2.3.tar.gz
fi
#ngx_devel_kit

if [ ! -e /opt/src/v0.3.0rc1.tar.gz ];then
    wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0rc1.tar.gz
    tar xf v0.3.0rc1.tar.gz
fi
#luajit
if [ ! -e /opt/src/LuaJIT-2.0.4.tar.gz ];then
    wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz
    tar xf LuaJIT-2.0.4.tar.gz
fi
#lua-nginx-module
if [ !  -e /opt/src/v0.10.2.tar.gz  ];then
    wget https://github.com/openresty/lua-nginx-module/archive/v0.10.2.tar.gz
    tar xf v0.10.2.tar.gz
fi
if [ ! -e /Data/apps/luajit  ];then
    cd LuaJIT-2.0.4
    make
    make install PREFIX=/Data/apps/luajit
fi

if [ !  -e /etc/profile.d/luajit.sh ];then
cat > /etc/profile.d/luajit.sh  <

nginx配置文件

server 主机配置

location /lua {
            # MIME type determined by default_type:
            default_type 'text/plain';
            content_by_lua "ngx.say('Hello World Lua!')";
}

web页面访问

tengine-lua 安装_第1张图片
image.png

fpm打包

目录结构

/tmp/nginxinstall/Data/apps/nginx 

脚本

[root@budongshu]# cat /tmp/pro.sh 
#!/bin/bash
if [ `id avatar |grep avatar | wc -l` -eq 1 ]; then
    exit 0
else
        useradd avatar
    exit 0
fi
[root@budongshu]# cat /tmp/post.sh 
#!/bin/bash
if [  -e /Data/apps/nginx ] ;then 
  rm -fr /Data/apps/nginx  
  exit 0
else 
   exit 0
fi

命令安装

/usr/local/bin/fpm -s dir -t rpm -n hdf-tengine -v 2.2.0 --iteration 3.el6  -d 'pcre,pcre-devel,openssl-devel' --post-install /tmp/pro.sh --post-uninstall /tmp/post.sh  -f -C /tmp/nginxinstall/  --description 'proxy tengine lua 2.2.0 rpm' -p /opt/

你可能感兴趣的:(tengine-lua 安装)