#!/bin/bash
Ngx_bag="nginx-1.14.0"
Ngx_src="${Ngx_bag}.tar.gz"
Ngx_dir=/usr/local/nginx_14
# 安装nginx依赖软件
function install_depend_package {
yum install gcc-c++ zlib-devel pcre-devel automake -y
}
# 创建nginx源码包存放目录
function create_source_storage_directory {
if [ ! -d /usr/src/nginx ];then
mkdir /usr/src/nginx -p
fi
cd /usr/src/nginx
}
# 下载nginx源码包
function download_nginx_package {
if [ ! -f ${Ngx_src} ];then
wget -c http://nginx.org/download/${Ngx_src}
fi
}
# 编译安装nginx
function compile_install_nginx {
if [ ! -f ${Ngx_src} ];then
echo -e "