之前以为在CentOS上面安装配置 Nginx确定麻烦,因此一直没有动。今天试了一下发现还挺简单的,只须要几步就OK。nginx
Nginx 官网给出了详细的安装教程,安装Nginx 总结了一些 CentOS 上面的安装步骤:git
/etc/yum.repos.d/nginx.repo
文件,[nginx] name=nginx repo baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/ gpgcheck=0 enabled=1
yum -y install nginx
systemctl start nginx.service //启动apache systemctl stop nginx.service //中止apache systemctl restart nginx.service //重启apache systemctl enable nginx.service //设置apache开机启动
若是有特殊要求能够修改 /etc/nginx/
下面相应的配置文件github
Migrated to https://sheltonsuen.github.ioshell