linux-tutorial/codes/linux/ops/soft/nginx/install-nginx-by-rpm.sh

18 lines
616 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/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