Nginx 安裝過程中遇到的一些問題及解決方法

原文鏈接:http://www.cnblogs.com/Detector/p/6946388.html

安裝

獲取安裝包

使用如下的命令可以在nginx官網獲取安裝包,博主獲取的是nginx-1.11.5這個版本

wget http://nginx.org/download/nginx-1.11.5.tar.gz

解壓安裝包

tar -zxvf nginx-1.11.5.tar.gz

切換到 nginx-1.11.5 目錄

執行 nginx下的configure進行配置

./configure

錯誤一

checking for C compiler ... not found

./configure: error: C compiler cc is not found

原因定位:沒有安裝gcc

解決方法:使用root用戶 執行 yum install gcc

gcc安裝成功界面

再次執行 ./configure

錯誤二

./configure: error: the HTTP rewrite module requires the PCRE library.

原因: 缺少pcre包

解決方法yum -y install pcre-devel 進行安裝

安裝後再次執行./configure

錯誤三

錯誤提示:./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library

原因:需要進行md5加密操作的沒有找到md5模塊

解決方法yum -y install openssl openssl-devel   安裝openssl加密模塊

再次執行./configure,終於成功了

然後再執行 make &&make install,執行過程沒有報錯,終於安裝成功了

啓動

nginx的啓動目錄在 /usr/local/nginx/sbin

直接進入該安裝目錄下,輸入命令 ./nginx -t 即可啓動

執行 ./nginx -s reload 可以進行重啓操作

修改配置文件

nginx的配置在/usr/local/nginx 目錄下的conf中


發佈了59 篇原創文章 · 獲贊 4 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章