nginx_download(){ for i in "$NGINX_VERSION.tar.gz" "$NGINX_PCRE_VERSION.tar.gz" do if [ -s packages/$i ]; then echo "$i [found]" else echo "Error: $i not found!!!download now......" wget http://www.paopao8.com/docs/soft/lnmp/packages/$i -P packages/ fi done } nginx_install(){ cd packages/ tar zxvf $NGINX_PCRE_VERSION.tar.gz cd $NGINX_PCRE_VERSION ./configure && make && make install cd ../ tar zxvf $NGINX_VERSION.tar.gz cd $NGINX_VERSION $NGINX_COMPILE_COMMAND make -j8 && make install cd ../../ pwd } nginx_main_conf(){ cat > $NGINX_PREFIX/conf/nginx.conf < $NGINX_PREFIX/conf/fastcgi_params < $NGINX_PREFIX/conf/vhosts/test.conf < /etc/init.d/nginx < /dev/null 2>&1 then printf "Nginx is down!!!\n" else printf "Nginx is running now!\n" fi } if [ "\$1" = "start" ]; then function_start elif [ "\$1" = "stop" ]; then function_stop elif [ "\$1" = "reload" ]; then function_reload elif [ "\$1" = "restart" ]; then function_restart elif [ "\$1" = "kill" ]; then function_kill elif [ "\$1" = "status" ]; then function_status else echo -en "\033[32;49;1m Usage: nginx {start|stop|reload|restart|kill|status}\n" echo -en "\033[39;49;0m" fi EOF }