一鍵安裝tengine(nginx)腳本

#!/bin/bash

#author: jorden

#date 2016-05-03

#version: 1.0



echo #####tengine 一鍵安裝###

####install dependent package#####

yum -y install  openssl openssl-devel zlib gcc gcc-c++ pcre cmake pcre pcre-devel


echo ""

echo "####add user and group######"

v_www=`cat /etc/passwd|grep www|wc -l`

if [ v_www=0 ];then

    groupadd www

    useradd www -s /sbin/nologin -M -g www

else

    echo -e "\033[31m user 'www' already exists! noting to do \033[0m"

fi


echo ""

echo -e "\033[32m #######install tengine to /usr/local/tengine####### \033[0m"

echo "wget tengine to /usr/local/src"

cd /usr/local/src

wget http://tengine.taobao.org/download/tengine-2.0.3.tar.gz

tar xf tengine-2.0.3.tar.gz

cd tengine-2.0.3

./configure --prefix=/usr/local/tengine --user=www --group=www --with-select_module --with-poll_module --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_spdy_module --with-http_secure_link_module --with-http_flv_module --with-http_concat_module=shared --with-http_sysguard_module=shared --with-http_sub_module --with-http_stub_status_module --with-http_ssl_module

make

make install


echo ""

echo "last you neet to do the next two steps "

echo -e "\033[31m ####1.configure the nginx.conf#### \033[0m"

echo -e "\033[31m ####2.start tengine use: /usr/local/tengine/sbin/nginx -c /usr/local/tengine/conf/nginx.conf #### \033[0m"


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章