2:根据.key生成.csr
/usr/bin/openssl req -new -key abc.com.key -out abc.com.csrPlease enter the following 'extra' attributesto be sent with your certificate requestA challenge password []:输入随机字符串,配合.csr文件的生成.
httpd.conf中配置:
################################MaxClients 96AddDefaultCharset GBKNameVirtualHost *:443ServerName abc.comDocumentRoot /home/admin/share/htdocsDirectoryIndex index.html## SSL informationSSLEngine onSSLCertificateFile /home/admin/conf/apache/ssl.crt/abc.com.crtSSLCertificateKeyFile /home/admin/conf/apache/ssl.key/abc.com.decrypt-key# SSLCACertificate* is necessary if you have a Global-ID certificate# such as the Thawte *.yahoo.com certificateSSLCACertificatePath /home/admin/conf/apache/ssl.crtSSLCACertificateFile /home/admin/conf/apache/ssl.crt/abc.com.ca################################
配置过程中可能出现的问题:
1、在windows中可能会出现找不到openssl.cnf的提示,apache根目录的conf/openssl.cnf即是。需要在命令中加上-config con/openssl.cnf即可解决。
2.如果配置好的ssl访问时网页提示 SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)可能是1)虚拟机配置出错,2)也可能是访问时直接在url中写了端口的缘故,不过真正原因不在显示写了端口,多半也是因为其中虚拟机配置错误引起。