码迷,mamicode.com
首页 > 其他好文 > 详细

一键源码安装ngxin

时间:2020-01-08 20:42:04      阅读:77      评论:0      收藏:0      [点我收藏+]

标签:编译   download   grep   bin   源码   evel   bsp   依赖   nload   

#!/bin/bash

nginxdir=nginx-1.16.1

nginx=/usr/local/nginx/sbin/nginx

author(){

echo "----------------------------------------------------------------------------------------------------"

echo "- nginx安装完毕 -"

echo "- 作者:lxl -"

echo "- 微信:l15565623507 -"

echo "----------------------------------------------------------------------------------------------------"

}

nginx_install(){

echo "解压nginx并安装nginx依赖环境中..."

echo "============================================="

tar -zxf nginx-1.16.1.tar.gz

yum -y install -q gcc gcc-c++ pcre-devel zlib-devel

echo "============================================="

echo "nginx编译"

echo "---------------------------------------------"

cd /usr/local/src/$nginxdir && ./configure && make && make install

echo "---------------------------------------------"

rm -rf $nginxdir

author

}

ss -ntlp|grep -q nginx

if [ $? -eq 0 ];then

echo "nginx已经存在"

else

cd /usr/local/src

if [ ! -e /usr/local/src/nginx-1.16.1 ];then

nginx_install

else

echo "nginx源码包下载中,请稍后......"

wget -q http://nginx.org/download/nginx-1.16.1.tar.gz

echo "下载完毕!"

nginx_install

author

fi

fi

 

一键源码安装ngxin

标签:编译   download   grep   bin   源码   evel   bsp   依赖   nload   

原文地址:https://www.cnblogs.com/l999999999/p/12168395.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!