1、下載依賴庫
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
sudo yum install epel-release
yum install nginx
2、檢查nginx 版本
nginx -v
3、nginx 命令
啓動nginx服務
systemctl start nginx.service
設置開機自啓動
systemctl enable nginx.service
停止開機自啓動
systemctl disable nginx.service
查看服務當前狀態
systemctl status nginx.service
重新啓動服務
systemctl restart nginx.service
查看所有已啓動的服務
systemctl list-units --type=service
4、查看nginx進程
ps -ef | grep nginx
默認的根目錄
/usr/share/nginx/html
5、修改配置文件
vim /etc/nginx/conf.d/default.conf
6、卸載
yum remove nginx