Centos環境下安裝nginx

來源:互聯網
上載者:User

第一步:
下載最新的nginx,地址nginx官方網站http://nginx.org/,選擇最新的

下載儲存
第二步:
在centos終端中download檔案夾中找到下載的檔案,執行解壓名寧命令 tar -zxvf nginx.tar,解壓成功後進入進入解壓得到的nginx檔案後運行 ./configure 命令,等待程式運行,一般會出現三個錯誤:
第一次運行 ./configure 命令會爆出 error:c compiler cc is not found ,這個是提示缺少c 或c++檔案,解決辦法:運行命令yum -y install gcc gcc -c++ autoconf automake 命令就可以線上安裝了,等待完成即可。
第二次運行./configure 命令會爆出error:the HTTP rewrite module requires the PCRE library,解決辦法:運行命令yum -y install pcre pcre-devel 命令就可以線上安裝了,等待完成即可。
第三次運行./configure 命令會爆出error:the HTTP gzip module requires the zlib library,解決辦法:運行命令yum -y install zlib zlib-devel 命令就可以線上安裝了,等待完成即可。
此時再次運行 ./configure 命令即可檢測成功下面make下 然後安裝 輸入make install 即可安裝完成。
第三步:
進入 /usr/local/目錄查看是否有nginx檔案夾,存在則表示安裝成功。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.