1.首先安装centos的扩展源
yum install epel-release
2.安装nginx
yum install nginx -y
启动nginx systemctl start nginx
查看进程 ps -ef|grep nginx
设置开机启动 systemctl enable nginx
3.配置文件
修改配置(不建议直接修改此配置文件,建议在/etc/nginx/conf.d目录下增加配置)
vim /etc/nginx/nginx.conf
增加配置文件
cd /etc/nginx/conf.d
vi ***.conf