Nginx1.6.0腳本自動化安裝

#!/bin/bash
# ------------------install Nginx 1.6.0 :: begin --------------------
nginx -v
if [ $? -eq 0 ];then
     nginx -v
     echo "nginx is exist..."
 else
     cd /app/service/tools
     tar zxvf nginx-1.6.0.tar.gz
     cd nginx-1.6.0
     ./configure --prefix=/usr/local/nginx \
     --prefix=/usr \
     --sbin-path=/usr/sbin/nginx \
     --conf-path=/etc/nginx/nginx.conf \
     --error-log-path=/var/log/nginx/error.log \
     --pid-path=/var/run/nginx/nginx.pid \
     --user=nginx \
     --group=nginx \
     --with-http_ssl_module \
     --with-http_flv_module \
     --with-http_gzip_static_module \
     --http-log-path=/var/log/nginx/access.log \
     --http-client-body-temp-path=/var/tmp/nginx/client \
     --http-proxy-temp-path=/var/tmp/nginx/proxy \
     --http-fastcgi-temp-path=/var/tmp/nginx/fcgi \
     --with-http_stub_status_module
     make && make install
     #創建用戶
     groupadd nginx
     useradd -g nginx nginx
     
     mkdir -p /var/tmp/nginx/client
     #啓動文件
     /usr/sbin/nginx
     #創建軟連接
     ls -n /usr/sbin/nginx  /usr/bin/nginx
fi


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