linux-tutorial/codes/linux/ops/soft/nginx/install-nginx-by-rpm.sh
2019-05-07 11:09:43 +08:00

18 lines
616 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
###################################################################################
# 安装 nginx 脚本
# 仅适用于 CentOS 发行版本。
# Author: Zhang Peng
###################################################################################
echo -e "\n>>>>>>>>> install nginx"
# Centos7 rpm 地址http://nginx.org/packages/rhel/7/x86_64/RPMS/
# CentOS6 rpm 地址http://nginx.org/packages/rhel/6/x86_64/RPMS/
mkdir -p /opt/nginx
wget -O /opt/nginx/nginx.rpm http://nginx.org/packages/rhel/7/x86_64/RPMS/nginx-1.14.0-1.el7_4.ngx.x86_64.rpm
rpm -ivh /opt/nginx/nginx.rpm
nginx -v