CenterOS7安装Nginx
===================
参考:https://www.xuliangwei.com/bgx/972.html
nginx官网下载地址:http://nginx.org/en/linux_packages.html
===================
1.安装编译工具及库文件
yum install -y gcc gcc-c++ autoconf pcre pcre-devel make automake wget httpd-tools vim tree
2.关闭防火墙
[root@izwz9ev02los7q1d71e7muz /]# systemctl disable firewalld
3.确认防火墙状态
[root@izwz9ev02los7q1d71e7muz /]# systemctl status firewalld
4.关闭selinux
[root@izwz9ev02los7q1d71e7muz /]# setenforce 0
5.确认selinux状态
[root@izwz9ev02los7q1d71e7muz /]# getenforce
6.创建目录文件夹
[root@izwz9ev02los7q1d71e7muz /]# mkdir /soft/{code,logs,package/src} -p
7.确认目录情况
[root@izwz9ev02los7q1d71e7muz /]# tree /soft/
8.配置nginx的yum源
[root@izwz9ev02los7q1d71e7muz /]# vim /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
#注意:此处centeros版本根据自己实际情况配置
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
10.安装nginx
yum install nginx -y
11.安装成功,查看版本
[root@iZwz9ev02los7q1d71e7muZ ~]# nginx -v