首页 > 其他 > 详细

nginx编译安装

时间:2020-04-17 17:41:16      阅读:60      评论:0      收藏:0      [点我收藏+]
#!/bin/bash
#安装nginx脚本
###################nginx编译安装脚本##################################
systemctl staus nginx
if [ $? -eq 0 ] ;then 
	echo "nginx is installed"
	exit
else
		test  -d /root/nginx  
		if [ $? -eq 0 ];then
		wget -P /root/nginx/ http://nginx.org/download/nginx-1.16.1.tar.gz
		mv /root/nginx/nginx-1.16.1.tar.gz  /root/shell2/

		tar -xvzf nginx-1.16.1.tar.gz  

		cd nginx-1.16.1

		./configure --prefix=/usr/local/nginx2 && sleep 3 
	else
		mkdir -pv /root/nginx
	fi
	if [ $? -eq 0 ];then 
		make -j 2 && sleep 3 && make install 
		echo 
		echo -e "\033[31m nginx install successful! \033[0m"
		ln -s /usr/local/nginx2/sbin/nginx  /usr/bin/nginx
		clear
		nginx
		netstat -tanp | grep -w 80
		echo -e "\033[31m nginx service is started \033[0m"
	else
		echo -e "\033[31m error \033[0m"
	fi
fi

技术分享图片

 

nginx编译安装

原文:https://www.cnblogs.com/ccbyk-90/p/12721096.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!