錯誤詳情:
/configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-openssl=
option.
步驟1:先看下是否安裝OpenSSL依賴
注意:nginx不是全局的話需要到nginx的sbin里面執(zhí)行
nginx -V
結(jié)果:
[root@zwb ~]# nginx -V
nginx version: nginx/1.15.9
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
configure arguments: --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module
configure arguments中不包含** --with-http_ssl_module**這個參數(shù)的表示未安裝,否則可跳過安裝OpenSSL的步驟
步驟2:安裝OpenSSL(兩種方式)
第一種:通過yum 快速安裝
命令為:
# -y 自動安裝,需要確認全部為是,不然需要手動輸y/n
yum -y install openssl openssl-devel
等待完成即可
第二種:內(nèi)網(wǎng)離線安裝
源碼文件下載地址:https://www.openssl.org/,進入download中,我用的是1.1所以我下載是這個,看實際情況而定
下載好之后解壓到路徑中,記住這個路徑,一會要用?。?!
步驟3
進入Nginx的源碼包,注意是源碼包,就是你從Nginx官網(wǎng)下載然后解壓的包,里面有一個configure名字的可執(zhí)行文件,然后執(zhí)行:
通過yum安裝的
./configure --with-http_ssl_module
離線安裝的
./configure --with-http_ssl_module --with-openssl=離線解壓的路徑(上一步讓你記住的那個)
然后進行編譯:
make && make install
只用make也行,會在Nginx目錄下的objs中生成編譯文件,上述命令則會直接編譯并安裝,默認路徑為:/usr/local/nginx/sbin
步驟4
確認是否安裝成功
nginx -V
結(jié)果如下就成功了文章來源:http://www.zghlxwxcb.cn/news/detail-742805.html
步驟五
給Nginx增加SSL證書,可參考https://blog.csdn.net/weixin_43672305/article/details/131858293文章來源地址http://www.zghlxwxcb.cn/news/detail-742805.html
到了這里,關(guān)于Nginx增加SSL證書時報錯:/configure: error: SSL modules require the OpenSSL library.的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!