CentOS7安装Nginx
一、使用官网安装包编译安装
1. 安装编译安装所需要的依赖
sudo yum install -y gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
2.下载Nginx
sudo yum install -y wget
wget https://nginx.org/download/nginx-1.14.0.tar.gz
3. 解压
tar zxf nginx-1.14.0.tar.gz
cd nginx-1.14.0
4. 编译安装(指定目录)
# 若不指定prefix,默认安装目录是/usr/loc