Difficulties in obtaining certificates Lets Encript

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

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`


1 Like

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…