The code that is currently throwing that error was placed in there to avoid confusion or mistakes when copying over HTTPS vhosts.
A more appropriate error might be… “Only 1 vhost per file is currently supported”
The client will attempt to split off the SSL vhosts as separate files, copying over the content and then including the additional TLS/HTTPS specific directives needed. If HTTPS was only selected for one of the vhosts. The file would need to be split, and the new file would require a different naming convention.
I haven’t yet addressed this complication. Hence the currently thrown error.
Deleting the second VirtualHost block in that file should have corrected the problem though. (Ideally the second virtual host would go in its own appropriately named file.) That error is only thrown when attempting to make an HTTPS vhost when the original vhost file contains multiple virtual hosts.
I am very surprised the error persisted. You don’t have any directories under sites-available, do you?
the vhost ist working now, after deleting the second vhost (/sperating in a different file) and using this method:
sudo ./venv/bin/letsencrypt -d www.example.org run
but letsencrypt or letsencrypt run still dont work (and get the mentioned error message)
do the client store any files outside the
apache/ngnix folder, /etc/letsencrypt or ~/letsencrypt/venv/bin/letsencrypt?
maybe there are some cachefiles that cause the error
EDIT: Read @bmw’s post below mine; it’s actually still an active issue being tracked in #1042.
For future readers, it looks like this issue was resolved by Pull Request #1226, so multiple vhosts in a single Apache configuration file are now allowed.
#1226 actually solved a different issue. The problem there was the Apache plugin would fail to deploy a certificate to multiple vhosts, each in their own file, when the client was given the install subcommand.
If you’d like to track the progress on the limitation of one vhost per file, keep an eye on #1042.
I also still get the same problem. I tried already all I can think of. Now other vhosts in my httpd.conf, no other sites etc. loaded. But I am still unable to install the certificates.
Is there any workaround? can I manually install the certificates and if how?
thanks in advance
A little bit after my first post I found the topic "one vhost per file" where one of the users commented the following:
“I did some additional testing and it looks like certbot doesn’t like the fact that the tag is inside of httpd.conf - it would rather have it in a dedicated file.”
and this is exactly what was my problem. I took the vhost part out of my main httpd.conf and moved to a seperated files in /sites. Once done the automatic apache configuration and cert creation worked perfect.