DEV Community

Alejandro Bonilla
Alejandro Bonilla

Posted on

3 2

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: domain.com.sv, www.domain.com.sv 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} domain.com.sv [NC]
RewriteCond %{HTTPS} off
RewriteRule .*$ https://%{HTTP_HOST}%{REQUEST_URI}

RewriteCond %{HTTP_HOST} domain.com.sv [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 :(.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs