1.在/etc/yum.repos.d/目錄下建立nginx.reponginx
touch nginx.repo
2.編輯nginx.repovim
vim nginx.repo 內容以下: [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=0 enabled=1 說明:baseurl中的7,表明CentOS 7.x版本
1.執行安裝命令centos
yum install -y nginx
2.安裝以後,查看nginx的默認安裝目錄ui
whereis nginx
1.啓動nginxurl
nginx
2.中止nginx日誌
nginx -s stop(快速關機)或者 nginx -s quit(優雅的關機)
3.從新加載配置code
nginx -s reload
4.從新打開日誌文件進程
nginx -s reopen
1.使用ps命令it
ps -ax | grep nginx