DEV Community

Alejandro Bonilla
Alejandro Bonilla

Posted on

Install SSL certificate with Certbot in Centos 7

I'm a owner of HP ML110 Gen9 running CENTOS 7, with a ccTLD.
First you need a total configured services: named, httpd, firewalld. I don`t know if you need email with same domain to get the certificate, but configure postfix and dovecot.

Requirement 1:

You need a virtualhost, because certbot use your "domain.conf" (/etc/httpd/conf.d/domain.conf) for compare the configuration with this file.

Requirement 2:

-First install epel-release.

yum install epel-release.

-I don´t remember if you need utils, but go to install.

yum install yum-utils

Installing Certbot

Install Certbot

yum install certbot-apache

-Run Certbot

certbot --apache

Setting Cerbot

-It's intuitive for configure, email for notifications, type your domain:, and cerbot configure the redirect for your site; dont skip this step!!.

Requirement 3:

In my case certbot does not redirect well, maybe you need add this lines to .htaccess

RewriteEngine On
RewriteCond %{HTTP_HOST} [NC]
RewriteCond %{HTTPS} off
RewriteRule .*$ https://%{HTTP_HOST}%{REQUEST_URI}

RewriteCond %{HTTP_HOST} [NC]
RewriteCond %{HTTPS} off
RewriteRule .*$ https://%{HTTP_HOST}%{REQUEST_URI}

Requirement 4:

service httpd restart

I still don't configure the autorenew; and maybe you already know that I'm from El Salvador, reason for my bad english :(.

Top comments (0)