My domain is: irc.chattogratis.it
I ran this command: sudo certbot --nginx
It produced this output: This is from the log file:
2023-10-31 21:53:57,440:DEBUG:acme.client:Storing nonce: drGA4aWAl5ZhdyY-qvRIqfEoZQ-JN0noHgaIntbEmsTSvdiMkJ4
2023-10-31 21:53:57,443:DEBUG:certbot._internal.storage:Creating directory /etc/letsencrypt/archive.
2023-10-31 21:53:57,443:DEBUG:certbot._internal.storage:Creating directory /etc/letsencrypt/live.
2023-10-31 21:53:57,443:DEBUG:certbot._internal.storage:Writing README to /etc/letsencrypt/live/README.
2023-10-31 21:53:57,444:DEBUG:certbot._internal.storage:Creating directory /etc/letsencrypt/archive/irc.chattogratis.it.
2023-10-31 21:53:57,444:DEBUG:certbot._internal.storage:Creating directory /etc/letsencrypt/live/irc.chattogratis.it.
2023-10-31 21:53:57,444:DEBUG:certbot._internal.storage:Writing certificate to /etc/letsencrypt/live/irc.chattogratis.it/cert.pem.
2023-10-31 21:53:57,444:DEBUG:certbot._internal.storage:Writing private key to /etc/letsencrypt/live/irc.chattogratis.it/privkey.pem.
2023-10-31 21:53:57,445:DEBUG:certbot._internal.storage:Writing chain to /etc/letsencrypt/live/irc.chattogratis.it/chain.pem.
2023-10-31 21:53:57,445:DEBUG:certbot._internal.storage:Writing full chain to /etc/letsencrypt/live/irc.chattogratis.it/fullchain.pem.
2023-10-31 21:53:57,445:DEBUG:certbot._internal.storage:Writing README to /etc/letsencrypt/live/irc.chattogratis.it/README.
2023-10-31 21:53:57,454:DEBUG:certbot.configuration:Var account=6354fa1d86a49701e5f32e920a0a5155 (set by user).
2023-10-31 21:53:57,455:DEBUG:certbot._internal.plugins.selection:Requested authenticator nginx and installer nginx
2023-10-31 21:53:57,455:DEBUG:certbot._internal.plugins.selection:Requested authenticator nginx and installer nginx
2023-10-31 21:53:57,455:DEBUG:certbot._internal.storage:Writing new config /etc/letsencrypt/renewal/irc.chattogratis.it.conf.
2023-10-31 21:53:57,458:DEBUG:certbot._internal.display.obj:Notifying user:
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/irc.chattogratis.it/fullchain.pem
Key is saved at: /etc/letsencrypt/live/irc.chattogratis.it/privkey.pem
This certificate expires on 2024-01-29.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
2023-10-31 21:53:57,459:DEBUG:certbot._internal.display.obj:Notifying user: Deploying certificate
2023-10-31 21:53:57,464:DEBUG:certbot._internal.error_handler:Encountered exception:
Traceback (most recent call last):
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot/_internal/client.py", line 657, in deploy_certificate
self.installer.deploy_cert(
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot_nginx/_internal/configurator.py", line 251, in deploy_cert
vhosts = self.choose_vhosts(domain, create_if_no_match=True)
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot_nginx/_internal/configurator.py", line 362, in choose_vhosts
vhosts = [self._vhost_from_duplicated_default(target_name, True,
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot_nginx/_internal/configurator.py", line 411, in _vhost_from_duplicated_default
default_vhost = self._get_default_vhost(domain, allow_port_mismatch, port)
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot_nginx/_internal/configurator.py", line 449, in _get_default_vhost
raise errors.MisconfigurationError("Could not automatically find a matching server "
certbot.errors.MisconfigurationError: Could not automatically find a matching server block for irc.chattogratis.it. Set the `server_name` directive to use the Nginx installer.
2023-10-31 21:53:57,464:DEBUG:certbot._internal.error_handler:Calling registered functions
2023-10-31 21:53:57,545:DEBUG:certbot._internal.display.obj:Notifying user: Could not install certificate
2023-10-31 21:53:57,546:DEBUG:certbot._internal.display.obj:Notifying user: NEXT STEPS:
2023-10-31 21:53:57,546:DEBUG:certbot._internal.display.obj:Notifying user: - The certificate was saved, but could not be installed (installer: nginx). After fixing the error shown below, try installing it again by running:
certbot install --cert-name irc.chattogratis.it
2023-10-31 21:53:57,546:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File "/snap/certbot/3437/bin/certbot", line 8, in <module>
sys.exit(main())
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot/main.py", line 19, in main
return internal_main.main(cli_args)
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot/_internal/main.py", line 1873, in main
return config.func(config, plugins)
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot/_internal/main.py", line 1480, in run
raise installer_err
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot/_internal/main.py", line 1464, in run
_install_cert(config, le_client, domains, new_lineage)
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot/_internal/main.py", line 1058, in _install_cert
le_client.deploy_certificate(domains, path_provider.key_path, path_provider.cert_path,
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot/_internal/client.py", line 657, in deploy_certificate
self.installer.deploy_cert(
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot_nginx/_internal/configurator.py", line 251, in deploy_cert
vhosts = self.choose_vhosts(domain, create_if_no_match=True)
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot_nginx/_internal/configurator.py", line 362, in choose_vhosts
vhosts = [self._vhost_from_duplicated_default(target_name, True,
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot_nginx/_internal/configurator.py", line 411, in _vhost_from_duplicated_default
default_vhost = self._get_default_vhost(domain, allow_port_mismatch, port)
File "/snap/certbot/3437/lib/python3.8/site-packages/certbot_nginx/_internal/configurator.py", line 449, in _get_default_vhost
raise errors.MisconfigurationError("Could not automatically find a matching server "
certbot.errors.MisconfigurationError: Could not automatically find a matching server block for irc.chattogratis.it. Set the `server_name` directive to use the Nginx installer.
2023-10-31 21:53:57,549:ERROR:certbot._internal.log:Could not automatically find a matching server block for irc.chattogratis.it. Set the `server_name` directive to use the Nginx installer.
My web server is (include version): nginx 1.22.1
The operating system my web server runs on is (include version): debian 12
My hosting provider, if applicable, is: ovh cloud
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): certbot 2.7.3
Where exactly is this server_name I need to change? I am sorry, but I am noob when it comes to SSL certs and certbot.
I installed certbot through snapd ..but I really don't understand how to fix this, and would be very grateful for any help.
Thanks in advance.
Bjorn.