Instalar certificados SSL Let’s Encrypt en Apache en Linux Ubuntu

Para instalar certificados SSL Let’s Encrypt en Apache en Linux Ubuntu primero debes instalar certbot con el siguiente comando desde una terminal.

[simterm]$ sudo apt install certbot python3-certbot-apache [/simterm]

Para que certbot pueda de forma automática instalar los certificados necesarios en tu servidor primero debes haber configurado Virtualhosts, si no sabes como hacerlo te dejo a continuación el link del paso a paso.

Ahora para obtener los certificados ejecuta el siguiente comando desde una Terminal.

[simterm]$ sudo certbot –apache [/simterm]

Este comando te retornara un mensaje como el siguiente donde debes colocar una cuenta de correo valida donde te llegaran mensajes sobre renovaciones o de seguridad.

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): nombre@dominio

Después de agregar el correo y presionar Enter te pedira que aceptes los terminos de servicio.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

Luego de presionar Enter te mostrara los dominios que configuraste como VirtualHosts, aqui puedes seleccionarlos tecleando el numero que lo representa o simplemente presionando Enter sin colocar ningún numero para que los tome todos y veras un mensaje como el siguiente.

Obtaining a new certificate
Performing the following challenges:
http-01 challenge for your_domain
http-01 challenge for www.your_domain
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/your_domain-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/your_domain-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/your_domain-le-ssl.conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/your_domain-le-ssl.conf

Al finalizar este paso te preguntara si quieres que las consultas por HTTP se redirijan automáticamente a HTTPS, deberemos digitar el numero 2 y luego Enter como se muestra a continuación.

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Listo el mensaje a continuación te dice que el certificado Letsencrypt fue correctamente instalado, ahora solo debes probar en un navegador para confirmar que todo este bien.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://your_domain and
https://www.your_domain

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=your_domain
https://www.ssllabs.com/ssltest/analyze.html?d=www.your_domain
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/your_domain/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/your_domain/privkey.pem
   Your cert will expire on 2020-07-27. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
Oscar Meza

Share
Published by
Oscar Meza

Recent Posts

Cambiar la hora en RedHat 7

Para cambiar la hora en RedHat 7 usamos los siguientes comandos en una pantalla de…

56 años ago

Errores comunes al elegir Hosting (y cómo evitarlos)

Elegir un hosting parece sencillo… hasta que el sitio es lento, se cae o no…

56 años ago

Hosting Barato vs Hosting Premium: ¿cuál conviene realmente?

Elegir un hosting no es solo cuestión de precio. Muchos proyectos empiezan con un Hosting…

56 años ago

Como convertir videos mkv a mp4 en GNU Linux

Para convertir videos de mkv a mp4 en GNU Linux es súper fácil, puedes utilizar…

56 años ago

Permitir conexiones a ssh de ciertas IPs con iptables

Esta es una forma para permitir las conexiones a nuestro servidor ssh solo cuando vienen…

56 años ago

Como salvar las reglas creadas en IPTables en Ubuntu

La forma mas sencilla de salvar todas las reglas que has configurado en IPTables fue…

56 años ago