Make sure the system can use the Yum source to access the extranet.
Variable Nginx_path modify nginx installation path, default is/opt/nginx
Variable nginx_version Modify the installation version of Nginx, default to 1.10.0
#!/bin/bash
# The Nginx installation script automatically
# AUTHOR:STARTUPPP
location=$ (PWD)
Nginx_path=/opt/nginx
nginx_version=1.10.0
Echo-e "\ n-----------------------------------------"
echo "is performing installation, please wait a moment"
Groupadd nginx &>/dev/null
Useradd-m-s/sbin/nologin-g nginx &>/dev/null
Echo-e "is downloading, please wait\n"
Yum-y install wget gcc gcc-c++ automake autoconf libtool make pcre* zlib* openssl* lsof &>/dev/null
#wget http://118.144.79.137/download/nginx-1.10.0.tar.gz &>/dev/null
wget http://nginx.org/download/nginx-$NGINX _version.tar.gz
Echo-e "is installation, please wait\n"
Tar zxf nginx-$NGINX _version.tar.gz
CD nginx-$NGINX _version
./configure--prefix= $NGINX _path--user=nginx--group=nginx--with-http_ssl_module--with-http_realip_module &>/dev/null
Make &>/dev/null
Make install &>/dev/null
If [$?-eq 0]
Then
Echo-e "\nnginx installation succeeded \ n"
Else
Echo-e "\nnginx installation failed \ n"
echo Error && exit 10
Fi
Cd/opt
if [!-D Tools]
Then
mkdir Tools
Fi
Netstat-npult|grep Nginx
If [$?-eq 0]
Then
Echo-e "\n\n80 port is already occupied \ n Please modify Nginx port"
Else
$NGINX _path/sbin/nginx
Echo-e "\n\nnginx started \ n Listening port is 80"
ECHO-E "NGINX installation path is $nginx_path"
Fi
CD $LOCATION
MV nginx-1.10.0.tar.gz Nginx-1.10.0/opt/tools &>/dev/null
Echo-e "\ n-----------------------------------------"
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8A/0B/wKiom1gkVMSCozqkAAEaDuSd1qA434.jpg-wh_500x0-wm_3 -wmp_4-s_4194298697.jpg "title=" C830.tmp.jpg "alt=" Wkiom1gkvmscozqkaaeadusd1qa434.jpg-wh_50 "/>
This article is from the "STARTUPPP" blog, make sure to keep this source http://startuppp.blog.51cto.com/11847460/1871593
Linux under Nginx automatic deployment script