#!/bin/sh
yum install gcc c++ &&
cd /root/source
cat /etc/passwd | grep web
if [ $? -ne ]
then
useradd -m -s /sbin/nologin
fi
echo ####install prce ######
#wget https://sourceforge.net/projects/pcre/files/pcre/8.41/pcre-8.41.tar.gz/download &&
#tar -xf download
cd pcre-8.41
./configure && make && make install
echo #### install nginx #####
wget http://nginx.org/download/nginx-1.8.1.tar.gz &&
tar -xf nginx-1.8.1.tar.gz && cd ./nginx-1.8.1
./configure --prefix=/usr/local/nginx --user=web --group=web --with-http_stub_status_module --with-http_ssl_module &&
[ $? != 0 ] && err_exit "nginx configure err"
make
[ $? != 0 ] && err_exit "nginx make err"
make install
[ $? != 0 ] && err_exit "nginx make install err"
cd /lib
ln -s libpcre.so.0.0.1 libpcre.so.1
/usr/local/nginx/sbin/nginx