标签:shell
一、一键安装nginx脚本
#!/bin/bash
####################################
#Name:nginx_install.sh
#Author:doublelinux
#version:1.1
#Date:2017/08/19
####################################
yum -y install pcre pcre-devel
yum -y install openssl openssl-devel
mkdir -p /home/qiu/tools
cd /
mkdir application
useradd nginx -s /sbin/nologin -M
cd /home/qiu/tools
wgethttp://nginx.org/download/nginx-1.6.3.tar.gz
tar xf nginx-1.6.3.tar.gz
cd /home/qiu/tools/nginx-1.6.3
ls
./configure --user=nginx --group=nginx--prefix=/application/nginx-1.6.3 --with-http_stub_status_module--with-http_ssl_module
a=`echo $?`
if [ $a -eq 0 ];then
make
else
echo"configure is worrong!"
fi
b=`echo $?`
if [ $b -eq 0 ];then
make install
else
echo"make is worrong!"
fi
echo $?
ln -s /application/nginx-1.6.3//application/nginx
/application/nginx/sbin/nginx -t
/application/nginx/sbin/nginx
netstat -lnt | grep 80
/etc/init.d/iptables stop
setenforce 0
getenforce
###test###
a=`ifconfig|awk ‘NR==2‘|awk -F" "‘{print $2}‘`
echo -e " Congratuation!!!Now"
echo -e "Your IP is $a,Now,you can testit!"
echo "请在浏览器中输入IP,进行测试!"
本文出自 “doublelinux” 博客,谢绝转载!
标签:shell
原文地址:http://doublelinux.blog.51cto.com/12300166/1957690