官网下载
http://nginx.org/en/download.html
上传服务器并解压
解压命令 tar -xvf 安装包
安装nginx
刚才解压的根目录中执行如下命令
1. yum -y install gcc pcre-devel zlib-devel openssl openssl-devel #提前安装nginx的依赖项
2. ./configure # 报错没有权限,则执行命令:chmod + x configure
3. make #当前安装目录下执行
4. make install #当前安装目录下执行
5. whereis nginx #查找工作目录
6. cd 查找工作目录/sbin
7. a.启动命令: ./nginx
b.重启命令: ./nginx -s reload
c.关闭命令: ./nginx -s stop
8.cd 查找工作目录/conf vi nginx.conf #配置反写代理