前端開發--nginx番外篇

Centos7下Nginx開發使用(背景: 阿里雲ECS Centos7)html

安裝和啓動

  1. 安裝教程 Centos7安裝Nginx實戰

須要主意的以下:nginx

文中第四步 4.配置編譯參數命令:(能夠使用./configure --help查詢詳細參數) 如圖 執行。./configurecentos

啓動後查看 (4).查看是否啓動:ps -ef grep nginx 語法錯了ps -ef | grep nginx 也能夠使用netstat -ntpl 查看 不過須要yum -y install net-tools安全

  1. 啓動 centos7 ECS下啓動
/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.pidcentos7

具體狀況以下: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

相關文章
相關標籤/搜索