Erlang安装和“ /usr/local/ssl/lib/libcrypto.a:无法读取符号:错误值”

Sau*_*h S 5 erlang ssl rabbitmq

我正在尝试在Linux机器Red Hat Enterprise Linux Server 6.6版上安装RabbitMQ(3.6.1)。要安装rabbitMQ,首先我从源代码(otp_src_R16B03)安装了Erlang R16B03版本,然后执行以下命令

wget http://www.erlang.org/download/otp_src_R16B03.tar.gz
tar xvfz /usr/tmp/otp_src_R16B03.tar
cd otp_src_R16B03
LANG=C; export LANG
./configure --with-ssl=/usr/bin
Run Code Online (Sandbox Code Playgroud)

我收到如下所示的消息:

*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************

crypto         : OpenSSL is configured for kerberos but no krb5.h found
jinterface     : No Java compiler found
odbc           : ODBC library - link check failed
orber          : No C++ compiler found
ssh            : OpenSSL is configured for kerberos but no krb5.h found
ssl            : OpenSSL is configured for kerberos but no krb5.h found

*********************************************************************
*********************************************************************
**********************  APPLICATIONS INFORMATION  *******************
*********************************************************************

wx             : wxWidgets not found, wx will NOT be usable
*********************************************************************
Run Code Online (Sandbox Code Playgroud)

虽然我继续进行make&make install,但是在启动Rabbitmq服务器时出现以下错误

sbin/rabbitmq-server
Run Code Online (Sandbox Code Playgroud)

取得讯息

BOOT FAILED
===========

Error description:
   {error,{missing_dependencies,[crypto,ssl],[mochiweb,cowlib,cowboy]}}

Log files (may contain more information):
   /usr/tmp/rabbitmq_server-3.6.1/var/log/rabbitmq/rabbit.log
   /usr/tmp/rabbitmq_server-3.6.1/var/log/rabbitmq/rabbit-sasl.log

Stack trace:
   [{rabbit_plugins,ensure_dependencies,1,
                    [{file,"src/rabbit_plugins.erl"},{line,179}]},
    {rabbit_plugins,prepare_plugins,1,
                    [{file,"src/rabbit_plugins.erl"},{line,198}]},
    {rabbit,broker_start,0,[{file,"src/rabbit.erl"},{line,284}]},
    {rabbit,start_it,1,[{file,"src/rabbit.erl"},{line,303}]},
    {init,start_it,1,[]},
    {init,start_em,1,[]}]

{"init terminating in do_boot",{error,{missing_dependencies,[crypto,ssl],[mochiweb,cowlib,cowboy]}}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
Run Code Online (Sandbox Code Playgroud)

探索了多种解决方案后,我了解到我需要安装最新的Openssl并提供新安装的openssl的路径。

我从源代码安装了Openssl并与-fPIC一起安装

wget https://www.openssl.org/source/openssl-1.0.2.tar.gz
tar xvfz /usr/tmp/openssl-1.0.2.tar.gz
cd /usr/tmp/openssl-1.0.2
./config -fPIC
make 
make install 
Run Code Online (Sandbox Code Playgroud)

现在,新的openssl安装在bin / local / ssl位置,并且我使用以下配置重新安装了Erlang

export PATH="/usr/local/ssl/bin:$PATH”
export CFLAGS=-fPIC
cd /usr/tmp/otp_src_RB1603
LANG=C; export LANG
./configure --with-ssl=/usr/local/bin
make
make install
Run Code Online (Sandbox Code Playgroud)

现在我得到了错误

export PATH="/usr/local/ssl/bin:$PATH”
export CFLAGS=-fPIC
cd /usr/tmp/otp_src_RB1603
LANG=C; export LANG
./configure --with-ssl=/usr/local/bin
make
make install
Run Code Online (Sandbox Code Playgroud)

我无法解决此错误,没有任何建议。。请注意,我以root用户身份使用机器

jww*_*jww 1

/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(rsaz_exp.o): relocation R_X86_64_32 against `.rodata'
can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value**
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

您需要使用该shared选项构建 OpenSSL。对于 64 位 Intel 机器,可能类似于以下内容。

/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(rsaz_exp.o): relocation R_X86_64_32 against `.rodata'
can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value**
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

enable-ec_nistp_64_gcc_128使 EC Diffie-Hellman 速度提高 2 到 4 倍,但它有一些限制。您可以在 64 位 Intel 机器上使用它。另请参阅编译和安装 | 在 OpenSSL wiki 上配置选项。


另外,请确保make dcleanOpenSSL 1.0.2 及以下版本;或make distclean适用于 OpenSSL 1.1.0 及更高版本。否则,即使更改选项后,一些旧配置仍然存在。