Difficulties in obtaining certificates Lets Encript

Hey.
For our convenience, we set up a redirect so that when we enter
server address “mail.example.org” opened webmail page instead of secure https page.

# cat  /etc/httpd/conf.d/webmail.conf
<VirtualHost *:80>
ServerName mail.example.org
Redirect permanent / http://mail.example.org/webmail
</VirtualHost>

But after that, obtaining the Lets Encript certificate stopped working.
Can I configure both of these options to work at the same time?

Yes, to make letsencrypt work you need to exclude it from the redirect (not tested):

<VirtualHost *:80>
ServerName mail.example.org
RedirectMatch 301 ^(?!/\.well-known/acme-challenge/).* http://mail.example.org$0`
</VirtualHost>

Source:

1 Like

Hi
I need to make this in file /etc/httpd/conf.d/webmail.conf or enother one? Becouse if yes that didn’t quite work for me …

Yes in the file you created but instead of redirecting to http I recommend to get a letsencrypt cert and go with https.
I can test it later today…