重新启动Apache时出错-“ SSLCACertificateFile接受一个参数”

Zac*_*chC 2 apache ssl digital-certificate ssl-certificate

我正在尝试为我的网站设置SSL。在我的Apache网站托管文件中,我正在使用:

SSLEngine On
SSLCertificateFile /etc/ssl/localcerts/www.website.com.crt
SSLCertificateKeyFile /etc/ssl/localcerts/www.website.com.key
SSLVerifyClient require
SSLVerifyDepth 1
SSLCACertificateFile /etc/ssl/localcerts/ca-client.pem
Run Code Online (Sandbox Code Playgroud)

重新启动Apache时出现以下错误消息:

 * Restarting web server apache2                                                                                                          [fail]
 * The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 25 of /etc/apache2/sites-enabled/website.com.conf:
SSLCACertificateFile takes one argument, SSL CA Certificate file ('/path/to/file' - PEM encoded)
Action 'configtest' failed.
The Apache error log may have more information.
Run Code Online (Sandbox Code Playgroud)

如果我将SSLCACertifcateFile行注释掉,则该网站可以正常运行。如预期的那样,没有CACertificate的SSL是“不受信任的”。

我如何调试它以弄清楚为什么不能包含SSLCACertificateFile?错误是什么意思?

Sid*_*pac 5

您说您的“主机”文件包含SSLCACertificateFile行,也许是问题所在?将其移动到您的虚拟网站配置文件(/ etc / apache2 / sites-available / yourwebsite.com .conf)或默认配置文件(如果您正在使用该文件)(相同的目录,但default.conf或000-default.conf )

我不确定您的问题是什么,但对我来说,我在网站conf中的SSLCACertificateFile行之后发表评论。我正在使用Debian 8.5

nano /etc/apache2/sites-available/yourwebsite.com.conf
Run Code Online (Sandbox Code Playgroud)

我之后发表了评论,就像这样

SSLCACertificateFile    /etc/ssl/certs/ca.pem  #comment
Run Code Online (Sandbox Code Playgroud)

我删除了它,然后又重新工作了

SSLCACertificateFile    /etc/ssl/certs/ca.pem
Run Code Online (Sandbox Code Playgroud)

另外,请确保在SSLCACertificateFile之后有一个TAB,而不是一个空格。

另一个想法是,您正在使用service apache2 reload还是service apache2 restart ...?我建议尝试重新启动,看看(如果重新加载不起作用)。