Problem to renew certificate

Good

I am having the same problem as some other users. I have only been able to renew the mail certificate.

I provide the following data.

I tried to disable the https, the file list and removed the custom 404 web.

My domain is:

sorienrot.es

I ran this command:

certbot renew

It produced this output:

root@sorienrot:~# certbot renew                                  
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/mail.sorienrot.es.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not yet due for renewal

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/sorienrot.es.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for sorienrot.es
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (sorienrot.es) from /etc/letsencrypt/renewal/sorienrot.es.conf produced an unexpected error: Failed authorization procedure. sorienrot.es (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://sorienrot.es/.well-known/acme-challenge/Yr3fMaGMfzbp9MSAxi8281Bu0KMTzmhMMeNlWYfuBqI [164.132.204.91]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p". Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/sorienrot.es/fullchain.pem (failure)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The following certs are not due for renewal yet:
  /etc/letsencrypt/live/mail.sorienrot.es/fullchain.pem expires on 2019-06-29 (skipped)
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/sorienrot.es/fullchain.pem (failure)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: sorienrot.es
   Type:   unauthorized
   Detail: Invalid response from
   http://sorienrot.es/.well-known/acme-challenge/Yr3fMaGMfzbp9MSAxi8281Bu0KMTzmhMMeNlWYfuBqI
   [164.132.204.91]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
   2.0//EN\">\n<html><head>\n<title>404 Not
   Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address. 

My web server is (include version):

Server version: Apache/2.4.29 (Ubuntu)
Server built: 2019-04-03T13:22:37

The operating system my web server runs on is (include version):

Ubuntu 18.04.1 LTS
Linux ubuntu 4.15.0-44-generic #47-Ubuntu SMP Mon Jan 14 11:26:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

My hosting provider, if applicable, is:

OVH Dedicated Server

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):

No

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):

root@sorienrot:~# certbot --version
certbot 0.31.0

Extra information

<VirtualHost *:80>

	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

	<Directory "/var/www/html">
    		AllowOverride All
	</Directory>

root@sorienrot:~# apache2ctl -M | grep rewrite                   
     rewrite_module (shared)
    root@sorienrot:~# grep -ri 'sorienrot.es' /etc/apache2/*
    /etc/apache2/sites-available/mail.sorienrot.es-le-ssl.conf:        ServerName mail.sorienrot.es
    /etc/apache2/sites-available/mail.sorienrot.es-le-ssl.conf:        DocumentRoot /var/www/mail.sorienrot.es
    /etc/apache2/sites-available/mail.sorienrot.es-le-ssl.conf:SSLCertificateFile /etc/letsencrypt/live/mail.sorienrot.es/fullchain.pem
    /etc/apache2/sites-available/mail.sorienrot.es-le-ssl.conf:SSLCertificateKeyFile /etc/letsencrypt/live/mail.sorienrot.es/privkey.pem
    /etc/apache2/sites-available/sorienrot.es-le-ssl.conf:  ServerName sorienrot.es
    /etc/apache2/sites-available/sorienrot.es-le-ssl.conf:  ServerAdmin soporte@sorienrot.es
    /etc/apache2/sites-available/sorienrot.es-le-ssl.conf:# RewriteCond %{SERVER_NAME} =sorienrot.es
    /etc/apache2/sites-available/sorienrot.es-le-ssl.conf:SSLCertificateFile /etc/letsencrypt/live/sorienrot.es/fullchain.pem
    /etc/apache2/sites-available/sorienrot.es-le-ssl.conf:SSLCertificateKeyFile /etc/letsencrypt/live/sorienrot.es/privkey.pem
    /etc/apache2/sites-available/sorienrot.es.conf: ServerName sorienrot.es
    /etc/apache2/sites-available/sorienrot.es.conf: ServerAdmin soporte@sorienrot.es
    /etc/apache2/sites-available/sorienrot.es.conf:RewriteCond %{SERVER_NAME} =sorienrot.es
    /etc/apache2/sites-available/mail.sorienrot.es.conf:        ServerName mail.sorienrot.es
    /etc/apache2/sites-available/mail.sorienrot.es.conf:        DocumentRoot /var/www/mail.sorienrot.es
    /etc/apache2/sites-available/mail.sorienrot.es.conf:RewriteCond %{SERVER_NAME} =mail.sorienrot.es
    /etc/apache2/sites-available/default-ssl.conf:          SSLCertificateFile /etc/letsencrypt/live/sorienrot.es/fullchain.pem
    /etc/apache2/sites-available/default-ssl.conf:          SSLCertificateKeyFile /etc/letsencrypt/live/sorienrot.es/privkey.pem
    root@sorienrot:~# apache2ctl configtest                          
    Syntax OK
    root@sorienrot:~#

Hi @sorienrot

checking your domain via https://check-your-website.server-daten.de/?q=sorienrot.es there is a redirect http -> https.

Domainname Http-Status redirect Sec. G
http://sorienrot.es/
164.132.204.91 302 https://sorienrot.es/ 9.044 A
http://www.sorienrot.es/
164.132.204.91 302 https://www.sorienrot.es/ 0.040 A
https://sorienrot.es/
164.132.204.91 200 0.306 N
Certificate error: RemoteCertificateChainErrors
https://www.sorienrot.es/
164.132.204.91 200 0.297 N
Certificate error: RemoteCertificateNameMismatch, RemoteCertificateChainErrors
http://sorienrot.es/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de
164.132.204.91 302 https://sorienrot.es/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de 0.043 A
Visible Content: Found The document has moved here . Apache/2.4.29 (Ubuntu) Server at sorienrot.es Port 80
http://www.sorienrot.es/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de
164.132.204.91 302 https://www.sorienrot.es/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de 0.044 A
Visible Content: Found The document has moved here . Apache/2.4.29 (Ubuntu) Server at www.sorienrot.es Port 80
https://sorienrot.es/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de 404 0.203 N
Not Found
Certificate error: RemoteCertificateChainErrors
Visible Content: Not Found The requested URL /.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de was not found on this server. Apache/2.4.29 (Ubuntu) Server at sorienrot.es Port 443
https://www.sorienrot.es/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de 404 0.207 N
Not Found
Certificate error: RemoteCertificateNameMismatch, RemoteCertificateChainErrors

That’s ok, Letsencrypt follows these redirects.

You have shared the DocumentRoot of your port 80 vHost.

Has the port 443 vHost of that domain the same DocumentRoot?

Find that - and use it.

certbot run -a webroot -i apache -w yourPort443Webroot -d www.sorienrot.es -d sorienrot.es

This?

default-ssl.conf

<IfModule mod_ssl.c>
	<VirtualHost _default_:443>
		ServerAdmin webmaster@localhost

		DocumentRoot /var/www/html

		# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
		# error, crit, alert, emerg.
		# It is also possible to configure the loglevel for particular
		# modules, e.g.
		#LogLevel info ssl:warn

		ErrorLog ${APACHE_LOG_DIR}/error.log
		CustomLog ${APACHE_LOG_DIR}/access.log combined

		# For most configuration files from conf-available/, which are
		# enabled or disabled at a global level, it is possible to
		# include a line for only one particular virtual host. For example the
		# following line enables the CGI configuration for this host only
		# after it has been globally disabled with "a2disconf".
		#Include conf-available/serve-cgi-bin.conf

		#   SSL Engine Switch:
		#   Enable/Disable SSL for this virtual host.
		SSLEngine on

		#   A self-signed (snakeoil) certificate can be created by installing
		#   the ssl-cert package. See
		#   /usr/share/doc/apache2/README.Debian.gz for more info.
		#   If both key and certificate are stored in the same file, only the
		#   SSLCertificateFile directive is needed.

		SSLCertificateFile /etc/letsencrypt/live/sorienrot.es/fullchain.pem
		SSLCertificateKeyFile /etc/letsencrypt/live/sorienrot.es/privkey.pem
		Include /etc/letsencrypt/options-ssl-apache.conf

		#   Server Certificate Chain:
		#   Point SSLCertificateChainFile at a file containing the
		#   concatenation of PEM encoded CA certificates which form the
		#   certificate chain for the server certificate. Alternatively
		#   the referenced file can be the same as SSLCertificateFile
		#   when the CA certificates are directly appended to the server
		#   certificate for convinience.
		#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

		#   Certificate Authority (CA):
		#   Set the CA certificate verification path where to find CA
		#   certificates for client authentication or alternatively one
		#   huge file containing all of them (file must be PEM encoded)
		#   Note: Inside SSLCACertificatePath you need hash symlinks
		#		 to point to the certificate files. Use the provided
		#		 Makefile to update the hash symlinks after changes.
		#SSLCACertificatePath /etc/ssl/certs/
		#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

		#   Certificate Revocation Lists (CRL):
		#   Set the CA revocation path where to find CA CRLs for client
		#   authentication or alternatively one huge file containing all
		#   of them (file must be PEM encoded)
		#   Note: Inside SSLCARevocationPath you need hash symlinks
		#		 to point to the certificate files. Use the provided
		#		 Makefile to update the hash symlinks after changes.
		#SSLCARevocationPath /etc/apache2/ssl.crl/
		#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

		#   Client Authentication (Type):
		#   Client certificate verification type and depth.  Types are
		#   none, optional, require and optional_no_ca.  Depth is a
		#   number which specifies how deeply to verify the certificate
		#   issuer chain before deciding the certificate is not valid.
		#SSLVerifyClient require
		#SSLVerifyDepth  10

		#   SSL Engine Options:
		#   Set various options for the SSL engine.
		#   o FakeBasicAuth:
		#	 Translate the client X.509 into a Basic Authorisation.  This means that
		#	 the standard Auth/DBMAuth methods can be used for access control.  The
		#	 user name is the `one line' version of the client's X.509 certificate.
		#	 Note that no password is obtained from the user. Every entry in the user
		#	 file needs this password: `xxj31ZMTZzkVA'.
		#   o ExportCertData:
		#	 This exports two additional environment variables: SSL_CLIENT_CERT and
		#	 SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
		#	 server (always existing) and the client (only existing when client
		#	 authentication is used). This can be used to import the certificates
		#	 into CGI scripts.
		#   o StdEnvVars:
		#	 This exports the standard SSL/TLS related `SSL_*' environment variables.
		#	 Per default this exportation is switched off for performance reasons,
		#	 because the extraction step is an expensive operation and is usually
		#	 useless for serving static content. So one usually enables the
		#	 exportation for CGI and SSI requests only.
		#   o OptRenegotiate:
		#	 This enables optimized SSL connection renegotiation handling when SSL
		#	 directives are used in per-directory context.
		#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
		<FilesMatch "\.(cgi|shtml|phtml|php)$">
				SSLOptions +StdEnvVars
		</FilesMatch>
		<Directory /usr/lib/cgi-bin>
				SSLOptions +StdEnvVars
		</Directory>

		#   SSL Protocol Adjustments:
		#   The safe and default but still SSL/TLS standard compliant shutdown
		#   approach is that mod_ssl sends the close notify alert but doesn't wait for
		#   the close notify alert from client. When you need a different shutdown
		#   approach you can use one of the following variables:
		#   o ssl-unclean-shutdown:
		#	 This forces an unclean shutdown when the connection is closed, i.e. no
		#	 SSL close notify alert is send or allowed to received.  This violates
		#	 the SSL/TLS standard but is needed for some brain-dead browsers. Use
		#	 this when you receive I/O errors because of the standard approach where
		#	 mod_ssl sends the close notify alert.
		#   o ssl-accurate-shutdown:
		#	 This forces an accurate shutdown when the connection is closed, i.e. a
		#	 SSL close notify alert is send and mod_ssl waits for the close notify
		#	 alert of the client. This is 100% SSL/TLS standard compliant, but in
		#	 practice often causes hanging connections with brain-dead browsers. Use
		#	 this only for browsers where you know that their SSL implementation
		#	 works correctly.
		#   Notice: Most problems of broken clients are also related to the HTTP
		#   keep-alive facility, so you usually additionally want to disable
		#   keep-alive for those clients, too. Use variable "nokeepalive" for this.
		#   Similarly, one has to force some clients to use HTTP/1.0 to workaround
		#   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
		#   "force-response-1.0" for this.
		# BrowserMatch "MSIE [2-6]" \
		#		nokeepalive ssl-unclean-shutdown \
		#		downgrade-1.0 force-response-1.0

	</VirtualHost>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

sorienrot.es-le-ssl.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com
	
	ServerName sorienrot.es
	ServerAdmin soporte@sorienrot.es
	DocumentRoot /var/www/html

RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.

RewriteCond %{SERVER_NAME} =sorienrot.es
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

	<Directory "/var/www/html">
    		AllowOverride All
	</Directory>

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn



	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf


SSLCertificateFile /etc/letsencrypt/live/sorienrot.es/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sorienrot.es/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

So it’s the same webroot.

certbot run -a webroot -i apache -w /var/www/html -d www.sorienrot.es -d sorienrot.es

Which virtual host would you like to choose?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: mail.sorienrot.es-le-ssl.conf  | mail.sorienrot.es     | HTTPS | Enabled
2: glpi.conf                      | glpi.ochobitunbyte.pw |       | Enabled
3: 000-default.conf               |                       |       | Enabled
4: sorienrot.es-le-ssl.conf       | sorienrot.es          | HTTPS | Enabled
5: sorienrot.es.conf              | sorienrot.es          |       | Enabled
6: mail.sorienrot.es.conf         | mail.sorienrot.es     |       | Enabled
7: default-ssl.conf               |                       | HTTPS | Enabled
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

4 or 5?

Oh, what’s that?

Looks like Certbot shows new options :wink:

If you use 5, maybe Certbot creates a new port 443 vHost.

So choose 4, the existing vHost should be configured with the new certificate.

It works now. Thank you very much for the help.

For the future renewal should I do the same or just do the cerbot renew command?

1 Like

Certbot should save your input in the configuration files. So renew should work.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.