Centos7下Nginx開發使用(背景: 阿里雲ECS Centos7)html
須要主意的以下:nginx
文中第四步 4.配置編譯參數命令:(能夠使用./configure --help查詢詳細參數) 如圖 執行。
./configure
centos
啓動後查看 (4).查看是否啓動:
ps -ef grep nginx
語法錯了ps -ef | grep nginx
也能夠使用netstat -ntpl 查看 不過須要yum -y install net-tools
安全
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
最後若是仍是沒法訪問的問題阿里雲
一如本地nginx配置,線上Centos7也會報以下錯誤
nginx: [error] invalid PID number ; in /usr/local/nginx/logs/nginx.pid
centos7
具體狀況以下:nginx 從新加載命令./nginx -s reload,出現 nginx: [error] invalid PID number "" in "/usr/local/nginx/logs/nginx.pid"問題。spa
解決辦法: 第一步:執行命令 killall -9 nginx 殺掉nginx 進程 第二步:執行命令 /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 從新加載配置文件 第三步:執行命令 ./nginx -s reload 從新啓動nginx.net
參考連接code