I have already achieved an SSL certificate for my domain by certbot. the configuration is:

<VirtualHost *:80>
ServerAdmin admin@xxx.com
DocumentRoot "/root"
ServerName xxx.com
ServerAlias www.xxx.com
ErrorLog "/var/log/httpd/xxx.error_log"
CustomLog "/var/log/httpd/xxx.access_log" common
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.xxx.com [OR]
RewriteCond %{SERVER_NAME} =xxx.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

now I have installed Postfix SMTP Server and like to get a certificate for mail.xxx.com as well. how to get ssl certificate for my mail server now?

I have already tried the following command:

sudo certbot certonly --standalone -d mail.xxx.com

which outputs:

Problem binding to port 80: Could not bind to IPv4 or IPv6.
  • The way you are using certbot it requires http for authentication. You either need to run a web server on port 80 of the mail server or use an alternate method like DNS validation.
    – davidgo
    Sep 2 '20 at 11:06
  • Is something running on port 80 of your mail server at the moment?
    – davidgo
    Sep 2 '20 at 11:07
  • @davidgo I have installed apache which is listening on port 80
    – SAndroid
    Sep 2 '20 at 11:24
  • Why aren't you using the Apache plugin for certbot then? Sep 2 '20 at 15:17
  • 1
    @MichaelHampton you mean sudo certbot --apache?
    – SAndroid
    Sep 2 '20 at 15:18

You can try stopping Apache, so port 80 would be free and certbot can bind to it.

sudo systemctl stop httpd

sudo certbot certonly --standalone -d mail.xxx.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.