在_default_虚拟主机中configurationssl

在webmin中有一个默认的虚拟主机,这个指令看起来和文件ssl.conf相同。 它似乎处理所有请求端口443不处理其他虚拟服务器。

我尝试通过更改两行来将.crt和.key更改为我的自定义.crt和.key

# Server Certificate: # Point SSLCertificateFile at a PEM encoded certificate. If # the certificate is encrypted, then you will be prompted for a # pass phrase. Note that a kill -HUP will prompt again. A new # certificate can be generated using the genkey(1) command. #SSLCertificateFile /etc/pki/tls/certs/localhost.crt SSLCertificateFile /var/www/html/server.crt # Server Private Key: # If the key is not combined with the certificate, use this # directive to point at the key file. Keep in mind that if # you've both a RSA and a DSA private key you can configure # both in parallel (to also allow the use of DSA ciphers, etc.) #SSLCertificateKeyFile /etc/pki/tls/private/localhost.key SSLCertificateKeyFile /var/www/html/server.key 

但是在webmin中单击“应用更改”后出现错误

由于安全原因,您的一些私钥文件被encryption。 为了阅读他们,你必须提供密码短语。

服务器6313213113.static.ctinets.com:443(RSA)input密码短语:Apache:mod_ssl:错误:未find私钥。

我如何解决这个问题?

*更新*

 <VirtualHost 172.16.1.99:443> SSLEngine on SSLCertificateFile /var/www/html/server.crt SSLCertificateKeyFile /var/www/html/server.key DocumentRoot /var/www/html ServerName www.domain.com:443 DirectoryIndex index.php index.html index.htm index.shtml LogLevel debug HostNameLookups off #DefaultLanguage zh-cn AddLanguage en .en AddLanguage zh-CN .zh-cn AddLanguage zh-TW .zh-tw AddDefaultCharset UTF-8 AddCharset GB2312 .gb2312 .gb AddCharset utf-8 .utf8 AddCharset big5 .big5 .b5 UseCanonicalName off php_value memory_limit 32M </VirtualHost> 

在我configuration后httpd.conf

当我访问http://www.domain.com:443是可访问的,但是当我访问https://www.domain.com ,它可以访问……..,是什么问题?

私钥文件本身是用密码encryption的。 您需要删除此encryption,以便Apache可以加载它,而无需手动input密码。

你可以使用openssl来做到这一点:

 openssl pkey -in server.key -out server-nopassphrase.key