Nginx 安裝過程中遇到的一些問題及解決方法
阿新 • • 發佈:2017-06-05
requires nbsp margin req 命令 裝包 ... check sbin
一、安裝
獲取安裝包:
wget http://nginx.org/download/nginx-1.11.5.tar.gz
解壓安裝包:
tar -zxvf nginx-1.11.5.tar.gz
切換到 nginx-1.11.5 目錄
執行 ./configure
出現錯誤:
checking for C compiler ... not found
./configure: error: C compiler cc is not found
原因:沒有安裝gcc
解決方法:使用root用戶 執行 yum install gcc
安裝成功:
再次執行 ./configure
出現錯誤:
./configure: error: the HTTP rewrite module requires the PCRE library.
解決方法:
yum -y install pcre-devel
再次執行,出現錯誤
錯誤提示:./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library
解決方法:
yum -y install openssl openssl-devel
然後再執行 make &&make install
二、啟動
nginx的啟動目錄在 /usr/local/nginx/sbin 下
直接進入該安裝目錄下,輸入命令 ./nginx -t 即可啟動
也可以執行 ./nginx -s reload 進行重啟
配置文件的修改 也需在/usr/local/nginx 目錄下的conf中進行
Nginx 安裝過程中遇到的一些問題及解決方法