2017-05-31 41 views
0

我有一个配置了ssl的apache服务器。在Redhat linux中配置ssl apache

SSLCertificateFile /etc/certs/localhost.crt 
SSLCertificateKeyFile /etc/private/localhost.key 

现在我需要用新的证书(由我们的部门提供)来替换证书。 因为我已经分享了CSR并且他们发回了证书。

现在,他们已经共享了文件*的.p7b(包含PEM/Base64编码格式的证书。与DER编码的证书和颁发CA证书.p7b文件。)

但在阿帕奇ssl.conf我需要提供crt文件。如何从P7B

回答

1

安装Red Hat Linux服务器上的OpenSSL获得CRT文件/ CentOS的7

  1. 首先,我们需要在我们的服务器上安装的httpd,安装httpd的类型下面的命令, 百胜安装httpd的

  2. 安装的httpd后,现在我们需要安装了mod_ssl, 百胜安装了mod_ssl

  3. 现在,我们已经在服务器上安装OpenSSL的为好, 百胜安装OpenSSL的

  4. 安装的httpd后,mod_ssl的& OpenSSL的,我们需要使用下面的命令生成密钥, 的OpenSSL genrsa -out的ca.key 2048

  5. OpenSSL的REQ -new -key的ca.key - 出ca.csr(您可以通过按跳过步骤进入)

  6. OpenSSL的X​​509 -req -days 365 -in ca.csr -signkey的ca.key退房手续ca.cert

  7. CP ca.crt/etc/pki/tls/certs

  8. CP的ca.key的/ etc/PKI/TLS /私营/

  9. CP ca.csr的/ etc/PKI/TLS /私人

  10. VIM /etc/httpd/conf.d/ ssl.conf中

    了SSLCertificateFile /etc/pki/tls/certs/localhost.crt

更换由

SSLCertificateFile /etc/pki/tls/certs/ca.crt 

SSLCertificateKeyFile /etc/pki/tls/private/localhost.key 

通过

SSLCertificateKeyFile /etc/pki/tls/private/ca.key 


    11. httpd -t (check whether the above change are correct or not) 

    12. vim /etc/httpd/conf/httpd.conf 

Go to the bottom of the file and write 

<VirtaulHost *:443> 
    SSLEngine on 
    SSLCertificateFile /etc/pki/tls/certs/ca.crt 
    SSLCertificateKeyFile /etc/pki/tls/private/ca.key 
    servername localhost 
    Documentroot /var/www/html 
</VirtualHost> 
Save & Exit 

13. httpd -t (check whether the above change are correct or not) 

14. firewall-cmd –permanent –add-service=https 

15. firewall-cmd –permanent –add-port=443/tcp 

16. firewall-cmd --reload 

17. service httpd restart 
更换