mirror of
https://github.com/certbot/certbot.git
synced 2026-07-30 16:14:44 +02:00
Provide clear log messages when Apache tries a default vhost
This commit is contained in:
@@ -327,9 +327,12 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
|||||||
vhost = display_ops.select_vhost(target_name, self.vhosts)
|
vhost = display_ops.select_vhost(target_name, self.vhosts)
|
||||||
if vhost is None:
|
if vhost is None:
|
||||||
logger.error(
|
logger.error(
|
||||||
"No vhost exists with servername or alias of: %s. "
|
"No vhost exists with servername or alias of: %s "
|
||||||
"No vhost was selected. Please specify servernames "
|
"(or it's in a file with multiple files, which Certbot "
|
||||||
"in the Apache config", target_name)
|
"can't parse yet). "
|
||||||
|
"No vhost was selected. Please specify ServerName or ServerAlias "
|
||||||
|
"in the Apache config, or split vhosts into separate files.",
|
||||||
|
target_name)
|
||||||
raise errors.PluginError("No vhost selected")
|
raise errors.PluginError("No vhost selected")
|
||||||
elif temp:
|
elif temp:
|
||||||
return vhost
|
return vhost
|
||||||
|
|||||||
@@ -87,10 +87,11 @@ def _vhost_menu(domain, vhosts):
|
|||||||
"vhosts are not yet supported)".format(domain, os.linesep),
|
"vhosts are not yet supported)".format(domain, os.linesep),
|
||||||
choices, help_label="More Info", ok_label="Select")
|
choices, help_label="More Info", ok_label="Select")
|
||||||
except errors.MissingCommandlineFlag as e:
|
except errors.MissingCommandlineFlag as e:
|
||||||
msg = ("Failed to run Apache plugin non-interactively{1}{0}{1}"
|
msg = ("Encountered vhost ambiguity but unable to ask for user guidance in "
|
||||||
"(The best solution is to add ServerName or ServerAlias "
|
"non-interactive mode. Currently Certbot needs each vhost to be "
|
||||||
"entries to the VirtualHost directives of your apache "
|
"in its own conf file, and may need vhosts to be explicitly "
|
||||||
"configuration files.)".format(e, os.linesep))
|
"labelled with ServerName or ServerAlias directories.")
|
||||||
|
logger.warn(msg)
|
||||||
raise errors.MissingCommandlineFlag(msg)
|
raise errors.MissingCommandlineFlag(msg)
|
||||||
|
|
||||||
return code, tag
|
return code, tag
|
||||||
|
|||||||
@@ -124,12 +124,12 @@ class ApacheTlsSni01(common.TLSSNI01):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
vhost = self.configurator.choose_vhost(achall.domain, temp=True)
|
vhost = self.configurator.choose_vhost(achall.domain, temp=True)
|
||||||
except (PluginError, MissingCommandlineFlag):
|
except (PluginError, MissingCommandlineFlag), e:
|
||||||
# We couldn't find the virtualhost for this domain, possibly
|
# We couldn't find the virtualhost for this domain, possibly
|
||||||
# because it's a new vhost that's not configured yet (GH #677),
|
# because it's a new vhost that's not configured yet (GH #677),
|
||||||
# or perhaps because there were multiple <VirtualHost> sections
|
# or perhaps because there were multiple <VirtualHost> sections
|
||||||
# in the config file (GH #1042). See also GH #2600.
|
# in the config file (GH #1042). See also GH #2600.
|
||||||
logger.warn("Attempting to fall back to default vhost %s...", default_addr)
|
logger.warn("Falling back to default vhost %s...", default_addr)
|
||||||
addrs.add(default_addr)
|
addrs.add(default_addr)
|
||||||
return addrs
|
return addrs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user