在 Linux 上安装 Crypt::SSLeay 时出错
所以我尝试使用 SSL 安装 Apache,即 Apache Openssl 和 SSLeay。我已经不再使用 Apache2 和 Openssl,知道安装 SSLeay 时遇到困难。在所有命令都失败之后,我到达了 perl Makefile.PL
。
perl Makefile.PL
Found multiple possibilities for OpenSSL
/opt/ssl (OpenSSL 0.9.8r)
/usr (OpenSSL 0.9.8p)
Which SSL install path do you want to use? [/opt/ssl]
build information
================================================
ssl library: OpenSSL 0.9.8r in /opt/ssl
ssl header: openssl/ssl.h
libraries: -L/opt/ssl/lib -lssl -lcrypto -lgcc
include dir: -I/opt/ssl/include
================================================
Note (probably harmless): No library found for -lgcc
Writing Makefile for Crypt::SSLeay
The test suite can attempt to connect to public servers
to ensure that the code is working properly. If you are
behind a strict firewall or have no network connectivity,
these tests may fail (through no fault of the code).
Do you want to run the live tests (y/N)? [N]
我选择 /usr 安装,因为这是我安装了 openssl-devel 的安装,因为我查看了 这个问题,类似,发现需要openssl-devel。所以我安装了 openssl-devel
rpm -qi openssl
Name : openssl Relocations: (not relocatable)
Version : 0.9.8a Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release : 18.36 Build Date: Mon 27 Jul 2009 03:55:03 PM CEST
Install Date: Mon 18 Jan 2010 10:42:42 AM CET Build Host: deacon.suse.de
Group : Productivity/Networking/Security Source RPM: openssl-0.9.8a-18.36.src.rpm
Size : 2998754 License: BSD 3-Clause
Signature : DSA/SHA1, Mon 27 Jul 2009 03:57:14 PM CEST, Key ID a84edae89c800aca
Packager : http://bugs.opensuse.org
URL : http://www.openssl.org/
Summary : Secure Sockets and Transport Layer Security
rpm -qi openssl-devel
Name : openssl-devel Relocations: (not relocatable)
Version : 0.9.8p Vendor: PLD
Release : 1 Build Date: Fri 19 Nov 2010 12:24:41 PM CET
Install Date: Wed 05 Oct 2011 03:47:56 PM CEST Build Host: x86-64.titanium.pld-linux.org
Group : Development/Libraries Source RPM: openssl-0.9.8p-1.src.rpm
Size : 2003899 License: Apache-like
Signature : (none)
Packager : PLD
URL : http://www.openssl.org/
Summary : Development part of OpenSSL Toolkit libraries
Description :<br/>
Development part of OpenSSL library.
Distribution: PLD Titanium
但是知道当我运行 make
时我仍然收到以下错误
make
cc -c -I/opt/ssl/include -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -Wall -pipe -DVERSION=\"0.58\" -DXS_VERSION=\"0.58\" -fPIC "-I/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/CORE" SSLeay.c
SSLeay.c: In function âXS_Crypt__SSLeay__CTX_newâ:
SSLeay.c:118: warning: unused variable âpacknameâ
SSLeay.c: In function âXS_Crypt__SSLeay__Conn_newâ:
SSLeay.c:395: warning: unused variable âpacknameâ
SSLeay.c: In function âXS_Crypt__SSLeay__CTX_use_pkcs12_fileâ:
SSLeay.c:287: warning: âRETVALâ may be used uninitialized in this function
Running Mkbootstrap for Crypt::SSLeay ()
chmod 644 SSLeay.bs
rm -f blib/arch/auto/Crypt/SSLeay/SSLeay.so
cc -shared -L/usr/local/lib64 SSLeay.o -o blib/arch/auto/Crypt/SSLeay/SSLeay.so \
-L/opt/ssl/lib -lssl -lcrypto
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: /opt/ssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/opt/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Crypt/SSLeay/SSLeay.so] Error 1
我认为原因是 perl 找不到 openssl-devel 库,如果是这样我该如何链接它所以可以找到。
预先感谢全能的鲍勃
So i'm trying to install Apache with SSL ergo Apache Openssl and SSLeay. I'm done with Apache2 and Openssl know i'm having difficulties getting SSLeay installed. I get as far as perl Makefile.PL
after that all commands fail.
perl Makefile.PL
Found multiple possibilities for OpenSSL
/opt/ssl (OpenSSL 0.9.8r)
/usr (OpenSSL 0.9.8p)
Which SSL install path do you want to use? [/opt/ssl]
build information
================================================
ssl library: OpenSSL 0.9.8r in /opt/ssl
ssl header: openssl/ssl.h
libraries: -L/opt/ssl/lib -lssl -lcrypto -lgcc
include dir: -I/opt/ssl/include
================================================
Note (probably harmless): No library found for -lgcc
Writing Makefile for Crypt::SSLeay
The test suite can attempt to connect to public servers
to ensure that the code is working properly. If you are
behind a strict firewall or have no network connectivity,
these tests may fail (through no fault of the code).
Do you want to run the live tests (y/N)? [N]
I choose the /usr installation because that is the one that I have openssl-devel installed on, since i looked at this question, that is simmilar and found out that openssl-devel is needed. So I installed openssl-devel
rpm -qi openssl
Name : openssl Relocations: (not relocatable)
Version : 0.9.8a Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release : 18.36 Build Date: Mon 27 Jul 2009 03:55:03 PM CEST
Install Date: Mon 18 Jan 2010 10:42:42 AM CET Build Host: deacon.suse.de
Group : Productivity/Networking/Security Source RPM: openssl-0.9.8a-18.36.src.rpm
Size : 2998754 License: BSD 3-Clause
Signature : DSA/SHA1, Mon 27 Jul 2009 03:57:14 PM CEST, Key ID a84edae89c800aca
Packager : http://bugs.opensuse.org
URL : http://www.openssl.org/
Summary : Secure Sockets and Transport Layer Security
rpm -qi openssl-devel
Name : openssl-devel Relocations: (not relocatable)
Version : 0.9.8p Vendor: PLD
Release : 1 Build Date: Fri 19 Nov 2010 12:24:41 PM CET
Install Date: Wed 05 Oct 2011 03:47:56 PM CEST Build Host: x86-64.titanium.pld-linux.org
Group : Development/Libraries Source RPM: openssl-0.9.8p-1.src.rpm
Size : 2003899 License: Apache-like
Signature : (none)
Packager : PLD
URL : http://www.openssl.org/
Summary : Development part of OpenSSL Toolkit libraries
Description :<br/>
Development part of OpenSSL library.
Distribution: PLD Titanium
But know i still get the following error when i run make
make
cc -c -I/opt/ssl/include -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -g -Wall -pipe -DVERSION=\"0.58\" -DXS_VERSION=\"0.58\" -fPIC "-I/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/CORE" SSLeay.c
SSLeay.c: In function âXS_Crypt__SSLeay__CTX_newâ:
SSLeay.c:118: warning: unused variable âpacknameâ
SSLeay.c: In function âXS_Crypt__SSLeay__Conn_newâ:
SSLeay.c:395: warning: unused variable âpacknameâ
SSLeay.c: In function âXS_Crypt__SSLeay__CTX_use_pkcs12_fileâ:
SSLeay.c:287: warning: âRETVALâ may be used uninitialized in this function
Running Mkbootstrap for Crypt::SSLeay ()
chmod 644 SSLeay.bs
rm -f blib/arch/auto/Crypt/SSLeay/SSLeay.so
cc -shared -L/usr/local/lib64 SSLeay.o -o blib/arch/auto/Crypt/SSLeay/SSLeay.so \
-L/opt/ssl/lib -lssl -lcrypto
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: /opt/ssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/opt/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Crypt/SSLeay/SSLeay.so] Error 1
I would think that the reason is that perl does not find the openssl-devel library, if so how do i link it so it can be found.
Thanks in advance Almightybob
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么不使用为您的发行版预先构建的版本?
(或一些近似的等价物)
Why not use the version that has been pre-build for your distribution?
(Or some close equivalent)
如果找不到该库,您通常会收到
未定义符号
错误。这看起来更像是它找到了图书馆但不喜欢它。您是否可能尝试将 32 位 openssl 与 64 位 perl 一起使用,反之亦然?If it can't find the library you usually get an
undefined symbol
error. This lookes more like it found the library but didn't like it. Is it possible you're trying to use a 32bit openssl with 64bit perl or vise versa?您对软件的各个部分感到困惑。
在 openSUSE 和相关发行版上,只需
sudo zypper install apache2
即可。 Apache httpd v2 已经包含一个名为 mod_ssl 的 OpenSSL 绑定;此命令将自动安装所有必要的依赖项,以通过 SSL 来提供内容,包括 OpenSSL 库。不需要编译任何东西。SSLeay 是 Perl HTTP 客户端 堆栈的一部分。它非常适合通过 SSL 访问远程服务器上其他人的内容。这与您想要的相反,但如果您仍然需要它,请首先添加存储库 < a href="http://download.opensuse.org/repositories/devel:/languages:/perl/" rel="nofollow">
devel:language:perl
,然后安装包裹perl-LWP-Protocol-https
。同样,这将自动引入所需的依赖项,包括perl-Net-SSLeay
。要添加通常与 Apache Web 服务器结合使用的 Perl 内容,请添加存储库
Apache:Modules
,然后还安装软件包apache2-mod_apreq2
、apache2-mod_perl
、libapreq2
、perl-Apache2-Request
。You are confused about the pieces of software.
On openSUSE and related distros, simply
sudo zypper install apache2
. The Apache httpd v2 already includes a binding to OpenSSL named mod_ssl; this command will automatically install all necessary dependencies to serve content over SSL, including the OpenSSL library. It is not needed to compile anything.SSLeay is part of the Perl HTTP client stack. It is good for accessing someone else's content on a remote server over SSL. This is the opposite of what you want, but if you desire it anyway, first add the repository
devel:language:perl
, then install the packageperl-LWP-Protocol-https
. Again, this will automatically pull in the required dependencies, includingperl-Net-SSLeay
.To add Perl stuff which is commonly used in conjunction with your Apache web server, add the repository
Apache:Modules
, then also install the packagesapache2-mod_apreq2
,apache2-mod_perl
,libapreq2
,perl-Apache2-Request
.