❶ linux openssl安裝後能重新安裝么,同一個安裝包
前段時間在該網站的博客里看到了雪源梅香的一篇「AndLinux,讓你在Windows系統下完美體驗Linux」,看完之後我立馬下載了最新版的AndLinux,並安裝到我的電腦上,一直以來,很想找個linux來練練手,之前嘗試過在虛擬機下安裝rh9,ubuntu。在虛擬機下安裝rh9感覺還行,但是裝上ubuntu之後特別卡,所以放棄嘗試了。畢竟第一次上手的linux系統式rh9,所以之後也給自己的電腦裝上了雙系統,xp+rh9,rh9找不到太多的更新軟體,所以最後還是放棄了。
安裝andLinux還算順利,唯一一處就是在我選擇「windows文件訪問方式」時,當我選擇了使用Samba之後,需要填入「Name of the Windows file share」時,是一個下拉框,也不明白該如何設置共享文件,所以下拉框始終都是空白,所以,最終的解決辦法就是使用COFS。
體驗了一段時間,感覺還不錯,至少不至於讓我的機器很卡(因為我的機器配置本身就不高)。
後來嘗試了下安裝中文版,一直都沒成功,還是放棄了,其實這對我的使用沒多大影響。還是非常滿意的。
之前在windows下裝過openssl,於是今天嘗試了下在linux下裝下openssl,一切還算順利。
我下載的openssl版本是openssl-0.9.8k.tar.gz.tar。首先是要將該安裝包放入上述提到的共享的windows文件下,這樣就可以在andlinux下找到該安裝包。(記住,要在root下進行安裝)
在安裝之前首先需要安裝一下libz才可以,否則make時會出錯:
#apt-get install libz-dev
接下來就可以放心安裝了。
首先將該安裝包復制到一個單獨的目錄下:
#cp openssl-0.9.8k.tar.gz.tar /var/openssl
再將openssl-0.9.8k.tar.gz.tar解包:
#tar xvf openssl-0.9.8k.tar.gz.tar
這時,就會在該目錄下有一個openssl-0.9.8k文件,進入該目錄:
#cd openssl-0.9.8k
這樣就可以開始安裝了:
(1)配置
#./config
(2)編譯
#make clean
#make
(3)安裝openssl
#make install
到此,安裝成功。
查看openssl版本:
#openssl version -a
OpenSSL 0.9.8g 19 Oct 2007
built on: Fri Mar 27 14:45:47 UTC 2009
platform: debian-i386-i686/cmov
options: bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) blowfish(idx)
compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O3 -march=i686 -Wa,--noexecstack -g -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM
OPENSSLDIR: "/usr/lib/ssl"
特別納悶的一件事就是:輸出的版本居然是0.9.8g。
安裝完成之後,可以使用test進行測試是否安裝成功:
#make test
……
OpenSSL 0.9.8k 25 Mar 2009
built on: Thu Jun 4 00:52:02 EDT 2009
platform: linux-elf
options: bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(idx)
compiler: gcc -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM
OPENSSLDIR: "/usr/local/ssl"
這才是正確的。/usr/local/ssl才是安裝的目錄。
查看該安裝目錄下的所有目錄名:
#ls
bin certs include lib man misc openssl.cnf private
其中:
bin:存放openssl的應用程序
certs:初始化的時候是空目錄,用於存放證書文件的默認目錄
include:存放使用openssl的靜態鏈接庫的時候需要的頭文件,以openssl目錄存放
lib:存放openssl靜態鏈接庫和動態鏈接庫
man:存放openssl的說明文檔
misc:存放一些腳本指令文件
private:初始化的時候是空目錄,用於存放私鑰文件的默認目錄。
openssl.cnf:應該是配置文件
❷ 如何在linux下安裝ssl證書
Apache安裝景安SSL證書需要三個配置文件
1
1_root_bundle.crt、2_domainname.com.crt、3_ domainname.com.key。
註:這三個文件在文件夾for Apache.zip中,其中domainname.com是您的域名,2_ domainname.com.crt為公鑰,3_domainname.com.key為私鑰。(文件後綴名crt和cer的性質是一樣的)
END
安裝證書
下載並解壓openssl。(1)確認文件的存放目錄,例當前目錄為:/usr/local。
解壓openssl。如:tar zxvf openssl-0.9.8k.tar.gz
配置openssl。(1)進入openssl目錄。如:cd openssl-0.9.8k。
2)配置openssl。如:./config shared zlib make make test make install mv /usr/bin/openssl /usr/bin/openssl.save mv /usr/include/openssl /usr/include/openssl.save mv /usr/lib/libssl.so /libssl.so.save ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl ln -s /usr/local/ssl/include/openssl /usr/include/openssl ln -sv /usr/local/ssl/lib/libssl.so.0.9.8 /usr/lib/libssl.so
安裝apache1.解壓文件:tar zxvf httpd-2.2.26.tar.gz2.進入目錄:cd httpd-2.2.263.配置安裝(/usr/local/ssl是openssl的安裝路徑):./configure --prefix=/usr/local/apache --enable-so --enable-ssl --with-ssl=/usr/local/ssl --enable-mods-shared=all
4.安裝:make && make install5.修改apache下的httpd.conf文件。(1)打開apache安裝目錄下conf目錄中的httpd.conf文件,找到 #LoadMole ssl_mole moles/mod_ssl.so #Include conf/extra/httpd-ssl.conf (2)刪除行首的配置語句注釋符號「#」,保存退出。6.修改apache下httpd-ssl文件。
如果本地測試,請做本地解析訪問:打開 系統盤:\Windows\System32\Drivers\etc\hosts文件,用文本編輯器修改,把證書綁定的域名解析到本地ip。
訪問https://+證書綁定的域名,測試效果如下:
❸ linux下的eclipse怎樣使用openssl
一、安裝
首先下載openssL的原始文件包,例如openssl-1.0.1f.tar.gz
將該文件復制到工作區目錄下,一般是/home下的個人文件夾
解壓文件tar zxvf openssl-1.0.1f.tar.gz
進入文件內 cd openssl-1.0.1f
配置,將生成的openssL文件復制到系統默認的文件夾下,該步驟只要復制下面的代碼就可以了:」./config --prefix=/usr/local/openssl shared」
執行make命令:make
使用root許可權,安裝openssL:sudo make install
至此,openssL安裝完成。完成的目錄中有兩個比較重要,一個是include包,裡面都是外部調用時可以查閱的.h頭文件,另一個是lib包,裡面有ssl和crypto的靜態和共享文件包。第二步的配置,主要是配置這兩個文件。
二、在eclipse中配置的方法
在eclipse中必須配置include和lib兩個變數。
新建一個C語言測試工程,例如openssL_test,右鍵-屬性-C/C++ Build-設置,然後單擊圖中右側第一個紅框,也就是GCC C Compiler 下的include,做如下設置,這里的path就是上面include的位置。
OpenSSL在Linux Eclipse下使用的完整過程-附截圖和測試程序
然後單擊GCC C Linker 下的libraries ,做如下設置:
OpenSSL在Linux Eclipse下使用的完整過程-附截圖和測試程序
ssl和crypto是用戶手動加上去的,但不是隨意寫的,其實這兩個變數對應著/usr/local/openssl/lib目錄下的libssl.so和libcrypto.so文件。
另外要注意,如果建的工程為C++類型,上圖中還會有一個G++的編譯器設置選項,設置方式與GCC的一樣就可以。
❹ linux下安裝openssl出錯的問題
你的linux好老啊,看你裝在虛擬機下,應該是自己學習的吧?為什麼不用新版的呢?
openssl版本又相對比較新,dependency估計很難滿足
直接用rpm包安裝吧
http://rpm.pbone.net/index.php3/stat/4/idpl/8472395/com/openssl-0.9.7a-33.24.1.el3.pp.i586.rpm.html
❺ linux中openssl安裝需要哪些軟體包
安裝環境:
操作系統:RedHat 12.0
OpenSSL Version:openssl-0.9.8l
Download
安裝包(Linux source) : openssl-0.9.8l.tar.gz(or the latest version of openssl)
下載地址:http://www.openssl.org/source/
在linux下解壓縮下載到的安裝包,命令如下.....
tar -xzf openssl-xxx.tar.gz
Our Configuration
Install to : /usr/local/ssl
Mole type : dynamically and staticly loaded moles, *.so *.a
Build Instructions
Configure
.../openssl-0.9.8l]# ./config --prefix=/usr/local/ssl-0.9.8l shared zlib-dynamic enable-camellia
--prefix=/usr/local/ssl-0.9.8l
[this is the installation location; default is '/usr/local/ssl' -- which we will symlink]
shared
[in addition to the usual static libraries, create shared libraries]
zlib-dynamic
[like "zlib", but has OpenSSL load the zlib library dynamically when needed]
enable-camellia
[enables the symmetric cipher 'Camellia' (128-bit, 192-bit, 256-bit key versions), which is now available for royalty-free use]
display guess on system made by './config'...
.../openssl-0.9.8l]# ./config -t
Build and Install
.../openssl-0.9.8l]# make depend
[step required since extra cipher was enabled]
.../openssl-0.9.8l]# make
.../openssl-0.9.8l]# make test
.../openssl-0.9.8l]# make install
Symlink
Form symlink from '/usr/local/ssl-0.9.8l' to '/usr/local/ssl'(...]代表「/usr/local/」)
...]# cd /usr/local
/usr/local]# ln -s ssl-0.9.8l ssl
Update the Run-time Linker
ld.so.cache will need to be updated with the location of the new OpenSSL shared libs: libcrypto.so.0.9.8 and libssl.so.0.9.8
Sometimes it is sufficient to just symlink or these two files to /lib, but we recommend you follow these instructions instead.
Edit /etc/ld.so.conf, add to paths...(修改效果如下圖1,當然也可以直接在/etc/ld.so.conf.d文件夾下再創建一個.conf文件,把/usr/local/ssl/lib拷貝到裡面,另外也可以在現有的.conf文件中添加這個路徑,反正ld.so.conf中包含了這個文件夾下的所有.conf文件)
❻ linux下如何安裝openssl包
1.解壓openssl-0.9.8k.tar.gz
2.從終端(命令行)進入解壓出來的目錄openssl-0.9.8k下,在命令行執行./config --prefix=/usr
3.執行make
4.執行sudo make install
安裝完看看usr/include目錄下有沒有openssl文件夾,有就安裝完成,可以直接引用裡面的md5.h了
❼ linux openssl-1.0.1g.tar.gz在哪個文件夾
直接yum -y install openssl
下載的源碼包看你指定的是哪裡,或者在當前目錄找
❽ linux安裝 openssl 為什麼要安裝zlib
安裝nginx之前需要安裝PCRE庫的安裝
最新下載地址 ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
tar –zxvf pcre-8.21.tar.gz,解壓目錄為:pcre-8.21
然後進入到cd pcre-8.21,進行配置、編譯、安裝
配置
./configure或./config
編譯
make
安裝
make install
安裝zlib庫安裝
tar -zxvf zlib-1.2.5.tar.gz
cd zlib-1.2.5
./configure
make
makeinstall
安裝openSSL庫
下載頁面:http://www.openssl.org/source/
tar –zxvf openssl-1.0.0.tar.gz,解壓目錄為:openssl-1.0.0
然後進入到cd openssl-1.0.0,進行配置、編譯、安裝
配置
./configure或./config
編譯
make
安裝
make install
4
以上三個庫確保安裝好後 接下來安裝nginx
tar zxvf nginx-1.1.12.tar.gz
cd nginx-1.1.12/
./configure --user=root --group=root--prefix=/usr/local/nginx--with-http_stub_status_mole --with-openssl=/usr/local/ssl/include/openssl
make && make install
cd ../
安裝完成後在/usr/local 下 會有個nginx目錄
❾ linux 可以openssl嗎
Openssl是用來生成一個密鑰的,我們通常是成對出來了,下面一起來看看在linux 下Openssl的安裝配置與使用方法,希望對各位有用。
1. Openssl介紹
自己網上找去吧,我說的不好!
2. 安裝
1、下載地址:http://www.openssl.org/source/ ;下一個最新新版本的OpenSSL,版本是:openssl-1.0.2-beta1.tar.gz
2、在下載的目錄中,用命令執行:tar -xzf openssl-openssl-1.0.2-beta1.tar.gz
3、進入解壓的目錄:openssl-1.0.2-beta1 [.......]#cd openssl-1.0.2-beta1
4、[.....openssl-1.0.2-beta1]# ./config --prefix=/usr/local/openssl
5、[...../openssl-1.0.2-beta1]# ./config -t
6、[...../openssl-1.0.2-beta1]# make depend (時間很長)
7、[.../openssl-1.0.2-beta1]# make (時間很長,慢慢等待)
8、[.../openssl-1.0.2-beta1]# maketest
9、[.../openssl-1.0.2-beta1]# makeinstall
10、[...../openssl-1.0.2-beta1]# cd /usr/local
11、[/usr/local]# ln -s openssl ssl
12、在/etc/ld.so.conf文件的最後面,添加如下內容:/usr/local/openssl/lib
13...]# ldconfig
14添加OPESSL的環境變數:
在etc/的profile的最後一行,添加:
export OPENSSL=/usr/local/openssl/bin
export PATH=$OPENSSL:$PATH:$HOME/bin
15退出命令界面,再從新登錄。
16、以上OPENSSL就安裝完畢,下面進行一些檢查。
17依次如下執行:
[root@localhost /]# cd /usr/local
[root@localhost local]# ldd /usr/local/openssl/bin/openssl
會出現類似如下信息:
linux-vdso.so.1 => (0x00007fff3bc73000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc5385d7000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc538279000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc5387db000)
18查看路徑
...]# which openssl
/usr/local/openssl/bin/openssl
19、...]# openssl version
OpenSSL 1.0.2-beta1 24 Feb 2014
3. 錯誤情況
自己寫的程序出現這個(fatal error: openssl/sha.h: No such fileor directory)或者相似的問題,一開始以為是環境變數的問題,重裝了幾次,後來差了網路才知道問題所在,都是沒有安裝libssl-dev,libssl-dev包含libraries, header files and manpages,他是openssl的一部分,而openssl對ssl進行了實現。解決方案:使用sudo apt-get install libssl-dev來安裝libssl-dev即可註:部分為網上抄襲!
下面來看使用方法,生成RSA
3.1 公私鑰對生成
命令解析:openssl genrsa[-out filename] [-passout arg] [-des] [-des3] [-idea] [-f4][-3] [-rand file(s)] [numbits]
OPTIONS
-out filename 私有密鑰輸入文件名,預設為標准輸出。
-passout arg 參看指令dsa裡面的passout參數說明 -des|-des3|-idea 採用什麼加密演算法來加密我們的密鑰。一般會要你輸入保護密碼。 如果這三個中一個也沒set, 我們的密鑰將不被加密而輸入。
-F4|-3 使用的公共組件,一種是3, 一種是F4, 我也沒弄懂這個option是什麼意思。
-randfile(s) 產生key的時候用過seed的文件,可以把多個文件用冒號分開一起做seed.
-numbits 指明產生的參數的長度。必須是本指令的最後一個參數。如果沒有指明,則產生512bit長的參數。 研究過RSA演算法的人肯定知道,RSA的私有密鑰其實就是三個數字,其中倆個是質數。這倆個呢,就叫prime numbers.產生RSA私有密鑰的關鍵就是產生這倆。還有一些其他的參數,引導著整個私有密鑰產生的過程。因為產生私有密鑰過程需要很多隨機數,這個過程的時間是不固定的。
//root@ubuntu:/mnt/hgfs/windows_linux/AlipayEx/study/opensslstudy/study#openssl genrsa -out RSAPrivateKey.pem 1024
//root@ubuntu:/mnt/hgfs/windows_linux/AlipayEx/study/opensslstudy/study#openssl rsa -in RSAPrivateKey.pem -pubout -out RSAPublicKey.pem
3.2 讀取密鑰
PEM_read_RSAPrivateKey
PEM_read_RSA_PUBKEY
具體參數看文檔去吧!
3.3 加解密
公鑰加密,私鑰解密
RSA_public_encrypt
RSA_private_decrypt
具體參數看文檔去吧!
3.4 簽名
私鑰簽名,公鑰驗簽
SHAwithRSA
1.SHA1M(自己封裝的)
2. RSA_sign(/*sha1withRSA第一個參數為NID_sha1,第二第三個參數為明文的sha1摘要及長度SA_verify
❿ 請教Linux下Openssl安裝的問題
使用VS2005下的Visual Studio 2005 Command Prompt進入控制台模式(這個模式會自動設置各種環境變數)、解壓縮openssl的包,進入openssl的目錄
、perl configure VC-WIN32
盡量在這個目錄下執行該命令,否則找不到Configure文件,或者指定完整的Configure文件路徑。
、ms\do_ms
在解壓目錄下執行ms\do_ms命令
、nmake -f ms\ntdll.mak編譯後在openssl解壓目錄下執行,完成編譯後。輸出的文件在out32dll裡面,包括應用程序的可執行文件、lib文件和dll文件
注意:在運行第五步時,cl編譯器會抱怨說.\crypto\des\enc_read.c文件的read是The POSIX name for this item is deprecated(不被推薦的),建議使用_read。呵呵,我可不想將OpenSSL中的所有的read函數修改為_read。再看cl的錯誤代碼 error C2220,於是上MSDN上查找:
warning treated as error - no object file generated
/WX tells the compiler to treat all warnings as errors. Since an error occurred, no object or executable file was generated.
是由於設置了/WX選項,將所有的警告都作為錯誤對待,所以。。。
於是打開OpenSSL目錄下的MS目錄下的ntdll.mak文件,將CFLAG的/WX選項去掉,存檔。