代码语言:javascript复制
#!/bin/bash
#unzip zip&tar file
function untarfile(){
for i in $( ls . |grep -v .sh)
do
val=$(echo $i | grep ".zip$" |wc -l)
if [[ "$val" -eq 1 ]];then
dirname=$(echo $i|sed "s/.zip//")
if [[ ! -d $dirname ]];then
echo "Unzip file: $dirname..."
unzip $i > /dev/null
fi
else
dirname=$(echo $i|sed "s/.tar.gz//")
if [[ ! -d $dirname ]];then
tar -zxvf $i > /dev/null
echo "Tar file: $dirname..."
fi
fi
done
sleep 2
echo "[ unzip files ] have finished!"
}
#untarfile
#install all
function installLua (){
#LuaJIT
if [[ ! -d /usr/local/lj2/ ]];then
cd LuaJIT-2.0.2
make PREFIX=/usr/local/lj2/
make install PREFIX=/usr/local/lj2/
else
echo "[ /usr/local/lj2/ ]: Directory have exists,exit!"
fi
echo "[ install LuaJIT ] have finished!"
sleep 2
}
function installnginx (){
if [[ ! -d /usr/local/nginx ]];then
cd nginx-1.6.1
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --without-select_module --without-poll_module --with-openssl=../o
penssl-1.0.1i --add-module=../ngx_devel_kit-0.2.19 --add-module=../lua-nginx-module-0.9.10
make
make -j2
make install
echo "/usr/local/lj2/lib/" > /etc/ld.so.conf.d/lj2.conf
ldconfig
else
echo "[ /usr/local/nginx ]: Directory have exists,exit!"
fi
echo "[ install nginx ] have finished!"
sleep 2
}
untarfile
installLua
installnginx
最新源码 包以及安装脚本位置: nginx的ssl和lua模块相关包