CentOS下OpenSSL的安裝和使用

來源:互聯網
上載者:User


1,安裝openssl

tar zxvf openssl-1.0.0a.tar.gz
cd openssl-1.0.0a
./config --prefix=/usr/local/openssl
make && make install

2,安裝apache

tar zxvf httpd-2.2.16.tar.gz
cd httpd-2.2.16
./configure --prefix=/usr/local/apache --enable-ssl --enable-rewrite --enable-so --with-ssl=/usr/local/openssl
make && make install

如果你是yum install ,apt-get,pacman這樣的軟體管理工具進行安裝的話,上面的二步可以省掉。

3,建立主認證

在/usr/local/apache/conf/下面建個目錄ssl

3.1,mkdir ssl

3.2,cp /openssl的安裝目錄/ssl/misc/CA.sh /usr/local/apache/conf/ssl/

3.3 用CA.sh來建立認證

查看複製列印

1.  [root@BlackGhost ssl]# ./CA.sh -newca //建立主認證

2.  CA certificate filename (or enter to create)

3.   

4.  Making CA certificate ...

5.  Generating a 1024 bit RSA private key

6.  ............++++++

7.  ......++++++

8.  writing new private key to './demoCA/private/./cakey.pem'

9.  Enter PEM pass phrase:

10. Verifying - Enter PEM pass phrase:

11. Verify failure

12. Enter PEM pass phrase:

13. Verifying - Enter PEM pass phrase:

14. -----

15. You are about to be asked to enter information that will be incorporated

16. into your certificate request.

17. What you are about to enter is what is called a Distinguished Name or a DN.

18. There are quite a few fields but you can leave some blank

19. For some fields there will be a default value,

20. If you enter '.', the field will be left blank.

21. -----

22. Country Name (2 letter code) [AU]:cn

23. State or Province Name (full name) [Some-State]:cn

24. Locality Name (eg, city) []:cn

25. Organization Name (eg, company) [Internet Widgits Pty Ltd]:cn

26. Organizational Unit Name (eg, section) []:cn

27. Common Name (eg, YOUR name) []:localhost

28. Email Address []:xtaying@gmail.com

29.  

30. Please enter the following 'extra' attributes

31. to be sent with your certificate request

32. A challenge password []:******************

33. An optional company name []:

34. Using configuration from /etc/ssl/openssl.cnf

35. Enter pass phrase for ./demoCA/private/./cakey.pem: //填的是上面的PEM密碼

36. Check that the request matches the signature

37. Signature ok

38. Certificate Details:

39. Serial Number:

40. 89:11:9f:a6:ca:03:63:ab

41. Validity

42. Not Before: Aug 7 12:35:28 2010 GMT

43. Not After : Aug 6 12:35:28 2013 GMT

44. Subject:

45. countryName = cn

46. stateOrProvinceName = cn

47. organizationName = cn

48. organizationalUnitName = cn

49. commonName = localhost

50. emailAddress = xtaying@gmail.com

51. 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.