Can't renew my ceryificate due to redirection http to https

I configured HTTP vhost to redirect to https. when I tried to renew my domain, I faced the below error then removed the redirection, works fine. so now how can I renew the certificate in case using redirection in my HTTP configuration.

My domain is: iiw.ibiidi.com

I ran this command: certbot renew

It produced this output:
Processing /etc/letsencrypt/renewal/iiw.ibiidi.com.conf
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/iiw.ibiidi.com/fullchain.pem (failure)


IMPORTANT NOTES:

  • The following errors were reported by the server:

    Domain: iiw.ibiidi.com
    Type: connection
    Detail: Fetching
    https://iiw.ibiidi.com.well-known/acme-challenge/qBqVo89h7N4sassutAJTYzpx-gyG2vp7JrglQbsgcAU:
    Error getting validation data

    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. Additionally, please check that
    your computer has a publicly routable IP address and that no
    firewalls are preventing the server from communicating with the
    client. If you’re using the webroot plugin, you should also verify
    that you are serving files from the webroot path you provided.

My web server is (include version): apache 2.14

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

My hosting provider, if applicable, is:

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

Hi @amna

there is a / missing. iiw.ibiidi.com.well-known is wrong, you need iiw.ibiidi.com/.well-known...

So add a slash to your redirect rule.

@JuergenAuer
sorry where can i add this “/”
my vhost (http) configiration file like below

<VirtualHost *:80>
    ServerAlias     iiw.ibiidi.com
    ServerName      iiw.ibiidi.com
    Redirect "/" "https://iiw.ibiidi.com"
    ServerAdmin     webmaster@ibiidi.com

    DocumentRoot     /dir2/dir1
    ErrorLog        /dir3/dir4/log/error_wiki.log
    CustomLog       /dir3/dir4/log/access_wiki.log common

<Directory/dir2/dir1>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted

At the end of your redirect command:

Redirect "/" "https://iiw.ibiidi.com/"

Ah, got it …sorry another question , why should i restart Apache after renew. as you know this not allowed in production environment

The Apache should use the new certificate. But you can do the restart later. Or you check the renew in the night.

PS: I see, now there

https://iiw.ibiidi.com/

is a new Letsencrypt certificate, created today. So it works :wink:

There are multiple ways to restart Apache. The "Graceful Restart" method (or equivalently the "reload" operations of the service or systemctl commands) is the usual choice for production environments and is sufficient for this purpose.

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