导入已签名的证书问题apache

时间:2017-10-12 07:37:35

标签: linux ssl

这是我第一次导入签名证书。 做了这里提到的一切: http://haraldwingerter.de/?p=267

现在我收到以下错误:

apache2ctl configtest
AH00526: Syntax error on line 3 of /etc/apache2/sites-enabled/000-default.conf:
ServerName takes one argument, The hostname and port of the server
Action 'configtest' failed.
The Apache error log may have more information.

日志没有说什么。

/etc/apache2/sites-enabled/000-default.conf

 <VirtualHost *:443>
DocumentRoot /var/www/owncloud
ServerName <servername> (ODER IP-Adresse)
  <IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
  </IfModule>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/servername.crt
SSLCertificateKeyFile /etc/ssl/private/servername.key
</VirtualHost>

/etc/apache2/sites-available/default-ssl.conf

 DocumentRoot /var/www/owncloud
 SSLCertificateFile /etc/ssl/certs/servername.crt
 SSLCertificateKeyFile /etc/ssl/private/servername.key

我认为我已将所有配置正确。问题在哪里找不到。

感谢您的帮助 托米

1 个答案:

答案 0 :(得分:0)

Sorry for the missing details!

Now I got rid of this errors but still didnt see the new certificate on the webside.

just changed inside /etc/apache2/sites-available/default-ssl.conf the following lines:

            SSLCertificateFile /etc/ssl/certs/owncloud.crt
            SSLCertificateKeyFile /etc/ssl/certs/owncloud.key
            SSLCertificateChainFile /etc/ssl/certs/DigiCertCA.crt

owncloud.crt > the file I got from digicert

owncloud.key > the key which was generated through csr before

DigiCertaCA.crt > the file I got with the new certificate

It is done like here described https://www.digicert.com/ssl-certificate-installation-apache.htm