openresty安裝配置,

來源:互聯網
上載者:User

openresty安裝配置,
安裝openresty需要的庫 apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential 構建 OpenResty進入下載好的壓縮包檔案中用下面的命令進行解壓 VERSION 為當前openresty的版本tar -xzvf openresty-VERSION.tar.gz 然後在進入 openresty-VERSION/  目錄, 然後輸入以下命令配置(預設配置安裝):./configure 編譯安裝下面命令進行編譯make下面的命令安裝 OpenResty到系統之中make install此時,我的系統中已經安裝好了Openresty,因為在配置時使用了預設安裝路徑,所以我的程式被安裝到了:/usr/local/openresty/中,該檔案夾中包含了luajit、lualib、nginx三個目錄。openresty的設定檔預設是在  /usr/local/openresty/nginx/conf

 

 運行nginx進入目錄,執行./nginx

 

沒報錯就運行起來了執行nginx -V 查看nginx 版本資訊   停止服務:
nginx -s reload  :修改配置後重新載入生效nginx -s reopen  :重新開啟記錄檔nginx -t -c /path/to/nginx.conf 測試nginx設定檔是否正確關閉nginx:nginx -s stop  :快速停止nginx         quit  :完整有序的停止nginx其他的停止nginx 方式:ps -ef | grep nginxkill -QUIT 主進程號     :從容停止Nginxkill -TERM 主進程號     :快速停止Nginxpkill -9 nginx          :強制停止Nginx啟動nginx:nginx -c /path/to/nginx.conf平滑重啟nginx:kill -HUP 主進程號

  

啟動服務
通過下述方式啟動Nginx。如果沒有任何輸出,說明啟動成功,-p 指定我們的項目目錄,-c 指定設定檔。/usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf/usr/local/openresty/nginx/sbin/nginx -p 'pwd' -c /usr/local/openresty/nginx/conf/nginx.conf為openresty下的nginx建立軟鏈(非必需)ln -s /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx則可使用如下方式啟動/usr/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf

安裝成功

1、/usr/local/openresty/site/lualib裡添加 resty和cjson的引用

  

問題解決:The program 'nginx' can be found in the following packages: 
* nginx-extras 
* nginx-full 
* nginx-light 
Try: apt-get install <selected package>  開始我以為是我的nginx安裝錯了,然後找各種教程仔細看安裝步驟,覺得沒有問題啊,折騰好久不知道該怎麼辦,最好在網友的提示下仔細看了提示,然後按照提示繼續做,即:apt-get install nginx-extras 斷行符號apt-get install nginx-full 斷行符號apt-get install nginx-light斷行符號

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.