之前以爲在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