環境:
起因:
nginx 需要ssl模塊重新編譯安裝,
使用命令:
./configure --prefix=/usr/local/localApp/env/nginx-1.6.1/ --with-http_stub_status_module --with-http_ssl_module
發現編輯報錯,找不到ssl模塊,需要手動指定openssl位置,
使用whereis 命令結果:
當時只有1,3 項,中間哪一項是我手動編譯安裝openssl後出現的,
使用命令:
./configure --prefix=/usr/local/localApp/env/nginx-1.6.1/ --with-http_stub_status_module --with-openssl= xxx --with-http_ssl_module
後指定爲1,3,兩項都會報錯,(一個爲腳本一個爲不知道什麼鬼的壓縮包不報錯纔怪)
於是手動編譯安裝openssl!!!!
安裝目錄爲/usr/local/ssl
openssl 至此搞定
=============================================================
回到nginx的源碼包,使用命令
./configure --prefix=/usr/local/localApp/env/nginx-1.6.1/ --with-http_stub_status_module --with-openssl= /usr/local/ssl --with-http_ssl_module
編譯時出現:
此類的錯誤,報錯找不到這些文件
===========================
解決方法:
進入nginx源碼包修改關於openssl的配置文件:
配置文件路徑:
修改conf中一下配置內容:
CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
爲:
CORE_INCS="$CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
==================================
再次編譯安裝,搞定!!!
=================================
順便提一下,原先系統中的openssl不要隨便卸載,坑很大,一個命令下去三十多個依賴沒了,chrome都被卸掉了!!
根據/var/log/apt/history.log 的日誌記錄又將依賴一個一個裝了回來!!!!!!!