2011-03-08 140 views
1

我正在創建一個需要使用perl模塊Crypt-SSLeay的Web應用程序。該模塊具有需要OpenSSL頭文件的依賴性。由於我的Linux服務器都沒有通過這些步驟來安裝,但由於我的經驗有限,我收到了一個很難理解的錯誤(見下文)。無法安裝Crypt-SSLeay模塊

服務器信息: 運行Oracle企業級Linux
Linux版本的2.6.18-194.11.4.0.1.el5([email protected])(gcc版本4.1.2 20080704(紅帽4.1.2-48))

步驟來複制問題:
下載並從here提取的OpenSSL 0.9.8r和運行下面的命令(將目錄)

./config --openssldir=/usr/local/openssl 
make 
make test 
sudo make install 

下載並解壓縮後, Crypt-SSLeay模塊從here然後輸入e運行以下命令

perl Makefile.PL 
make 

我收到以下錯誤(將目錄後)我運行「make」:

BUILD INFORMATION 
================================================ 
ssl library: OpenSSL 0.9.8r in /usr/local/openssl 
ssl header: openssl/ssl.h 
libraries: -L/usr/local/openssl/lib -lssl -lcrypto -lgcc 
include dir: -I/usr/local/openssl/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] 
-bash-3.2$ make 
gcc -c -I/usr/local/openssl/include -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"0.58\" -DXS_VERSION=\"0.58\" -fPIC "-I/usr/lib64/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 
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic SSLeay.o -o blib/arch/auto/Crypt/SSLeay/SSLeay.so  \ 
     -L/usr/local/openssl/lib -lssl -lcrypto  \ 

/usr/bin/ld: /usr/local/openssl/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 
/usr/local/openssl/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 

我不知道我需要什麼當我重新編譯OpenSSL來使這個模塊工作時。任何幫助讚賞。

回答

2

這看起來像是OpenSSL構建本身的錯誤。你確定你的發行版不提供OpenSSL頭文件嗎? (我相信你已經有了這些庫,對不對?)

標題在RedHat IIRC的一個名爲「openssl-devel」的包中,對於Oracle Enterprise Linux應該是一樣的(我想,從來沒有用過)。

如果您確實在發行版軟件包中找到了標頭,請不要忘記取消安裝您的自定義版本(如果OpenSSL Makefile沒有卸載目標,請手動刪除這些文件)。

+3

發現我錯過了什麼。當我剛剛使用命令「sudo yum install openssl-devel」時,我正在編譯OpenSSL。一切都在工作。謝謝! – arcdegree 2011-03-08 22:26:38

+0

很高興你解決它。不要忘記刪除自定義編譯的openssl庫。他們不應該傷害任何東西,但是具有半功能安全庫並不被認爲是安全人員的「最佳實踐」:-) – Mat 2011-03-08 22:29:15