让我们来encryptionapache上的SSL安装错误

我正在尝试在同一IP上的多个虚拟主机和域上安装ssl。 我为此使用了多个.conf文件。

已经有三个在这个IP与SSL的工作领域。 但是,当尝试使用命令在另一个域上安装ssl时:

certbot-auto --apache -d mydomain.com -d www.mydomain.com

得到这个错误:

所选的虚拟主机将与Apache中的其他HTTPS虚拟主机发生冲突。 请select另一个虚拟主机或将ServerNames添加到您的configuration。 VirtualHost无法被选中。

这里是我在mydomain.conf的configuration

  <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/mydomain/ ServerName mydomain.com ServerAlias www.mydomain.com <Directory /var/www/mydomain/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> RewriteEngine on RewriteCond %{SERVER_NAME} =www.mydomain.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]