解決辦法:主機可以聯網狀況下,直接運行以下命令便可在線安裝openssl、httpdhtml
須要提早安裝環境 httpd, mod_sslc++
yum install httpdapache
yum install mod_sslbash
安裝好以後, 重啓就行了ui
離線安裝httpd是個比較曲折的過程。spa
安裝包準備:.net
httpd安裝包下載:code
各歷史版本下載地址:http://httpd.apache.org/download.cgi#apache24 xml
最新版本下載地址:http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.39.tar.gzhtm
我下載的是httpd-2.4.26.tar.gz
另外須要安裝文件:
apr-1.6.2.tar.gz
apr-util-1.6.0.tar.gz
安裝httpd時須要安裝高版本的openssl,因此須要下載openssl:
openssl各版本下載地址:http://distfiles.macports.org/openssl/ 或者 https://ftp.openssl.org/source/
我下載的是 https://ftp.openssl.org/source/openssl-fips-2.0.16.tar.gz
安裝httd時須要安裝pcre,下載pcre:
各版本下載地址:https://sourceforge.net/projects/pcre/
我下載的是:https://sourceforge.net/projects/pcre/files/pcre/8.43/pcre-8.43.tar.gz/download
安裝過程以下:
安裝httpd:
解壓:
tar xf apr-1.6.2.tar.gz
tar xf apr-util-1.6.0.tar.gz
tar xf httpd-2.4.26.tar.gz
複製:
cp -a apr-util-1.6.0 httpd-2.4.26/srclib/apr-util
cp -a apr-1.6.2 httpd-2.4.26/srclib/apr
cd httpd-2.4.26
配置及環境檢查命令:
./configure --prefix=/data/httpd24 \
--enable-so \
--enable-ssl \
--enable-cgi \
--enable-rewrite \
--with-zlib \
--with-pcre \
--with-included-apr \
--enable-modules=most \
--enable-mpms-shared=all \
--with-mpm=prefork
檢查以後報錯:
checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
安裝pcre:
執行以下命令:
tar -zxvf pcre-8.43.tar.gz
cd pcre-8.43
./configure --prefix=/usr/local/pcre
make
make install
(注:若是configure報錯:no acceptable C compiler found in $PATH,則須要安裝gcc,
若是configure報錯:ivalid c++ compiler or c++ compiler flags,則是安裝gcc時 gcc-c++沒安裝,安裝上便可
詳情查看離線安裝gcc連接:https://www.cnblogs.com/qqflying/p/10916564.html
configure不成功後面的make,make install是成功不了的,會報錯:make: *** 沒有指明目標而且找不到 makefile。 中止。
)
而後從新進入
cd httpd-2.4.26
configure時,把pcre路徑加上
以下:
./configure --prefix=/data/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre=/usr/local/pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
執行以後報錯:
checking for OpenSSL version >= 0.9.7… FAILED
configure: WARNING: OpenSSL version is too old
no
checking whether to enable mod_ssl… configure: error: mod_ssl has been requested but can not be built due to prerequisite failures
這是自帶的OpenSSL版本過低,須要安裝新版本
執行以下命令:
tar -zxvf openssl-fips-2.0.16.tar.gz
cd openssl-fips-2.0.16
./config shared zlib --prefix=/usr/local/openssl && make && make install
查看openssl版本:
[root@cdh1 ~]# openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017
查看openssl安裝路徑
[root@cdh1 ~]# whereis openssl
openssl: /usr/bin/openssl /usr/lib64/openssl /usr/local/openssl /usr/share/man/man1/openssl
(如下步驟不僅是否必須,僅供參考:
安裝結束後執行如下命令
./config -t
make depend
進入/usr/local目錄下,執行如下命令
ln -s openssl ssl
在/etc/ld.so.conf文件的最後面,添加以下內容:/usr/local/openssl/lib
而後執行如下命令
ldconfig
添加OPESSL的環境變量,在etc/的profile的最後一行,添加:
export OPENSSL=/usr/local/openssl/bin
export PATH=$OPENSSL:$PATH:$HOME/bin
退出命令界面,再重新登陸,使配置生效。
原文:https://blog.csdn.net/shiyong1949/article/details/78212971
)
而後從新進入
cd httpd-2.4.26
configure時,把openssl的路徑加上
以下:
./configure --prefix=/data/httpd24 --enable-so --enable-ssl --with-ssl=/usr/local/openssl --enable-cgi --enable-rewrite --with-zlib --with-pcre=/usr/local/pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
配置檢測成功,而後執行
make
make install
安裝完成。
重啓Hue組件,變綠了,錯誤解除。
(注:若是make過程出現錯誤:xml/apr_xml.c:35:19: 致命錯誤:expat.h:沒有那個文件或目錄,則是由於沒有安裝expat開發庫,請查看gcc離線安裝那篇文章)