下載RPM:wget http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.10.0-1.el7.ngx.x86_64.rpmhtml
安裝: rpm -ivh nginx-1.10.0-1.el7.ngx.x86_64.rpmnginx
若是找不wget請安裝,命令:yum -y install wgetcentos
輸入命令: whereis nginxcentos7
執行目錄:/usr/sbin/nginxspa
模塊所在目錄:/usr/lib64/nginx/modules3d
配置所在目錄:/etc/nginx/rest
默認站點目錄:/usr/share/nginx/html日誌
主要配置文件:/etc/nginx/nginx.conf 指向:/etc/nginx/conf.d/default.confhtm
PID目錄:/var/run/nginx.pidblog
錯誤日誌:/var/log/nginx/error.log
訪問日誌:/var/log/nginx/access.log
命令1:systemctl status nginx.service
systemctl start nginx.service
systemctl stop nginx.service
systemctl reload nginx.service
systemctl status nginx.service
ps: centos6的啓動、中止、重載
/etc/init.d/nginx start
/etc/init.d/nginx stop
/etc/init.d/nginx restart
命令1:systemctl status nginx.service
以上nginx就已安裝成功了!!!
命令2:netstat -antp | grep :80(查看80端口被哪一個服務佔用)or netstat -antpuel | grep ":22" | grep -v grep(過慮grep自己)
命令3:netstat -antp | grep :(查看全部端口占用狀況)
命令4:ps aux | grep nginx(查看nginx進程運行狀態)or ps aux | grep :80 | grep -v grep(過慮grep自己)
a)相關nginx進行所有殺掉:killall -9 nginx
b)把PID兩個進程殺掉:kill -9 pid1 and kill -9 pid1
命令:nginx -V