让encryption和2个虚拟主机

我在Debian上安装了OwnCloud,使用apache。 我已经成功configuration了让encryption证书,这对files.example.com很好。

我想另一个域指向相同,但使用域files.example.net。 我为apache创build了一个新的conf文件,使用a2ensite创build一个链接,重新启动apache。 我改变了conf中的服务器名称来匹配额外的域名,但是当我用-d files.example.net运行cert bot命令时,出现以下错误;

Cannot find a cert or key directive in /files/etc/apache2/sites-available/001-default.conf/VirtualHost. VirtualHost was not modified Unable to find cert and/or key directives 

下面是Apache的第二个conf文件,第一个与域名不同。

 <VirtualHost *:443> ServerName files.extradomain.com ServerAlias files.extradomain.com ServerAdmin webmaster@localhost DocumentRoot /var/www/owncloud ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined #RewriteEngine on #RewriteCond %{SERVER_NAME} =files.extradomain.com #RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent] </VirtualHost> 

我添加了一个服务器别名到新的域的Apache conf。 然后我重新与certbot –apache,它会自动find两个域。 我确信当问及时我要求一个新的SSL证书。