Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Security»How to Secure Apache With Let’s Encrypt on Ubuntu 18.04 & 16.04

    How to Secure Apache With Let’s Encrypt on Ubuntu 18.04 & 16.04

    RahulBy RahulJanuary 26, 20182 Mins ReadUpdated:October 3, 2020

    Let’s Encrypt is a certificate authority (CA) providing free SSL/TLS certificates for enhanced security freely. You can generate CA-singed SSL certificate for any domain, subdomain without any cost and use on your server. It also provides an option to auto-renew SSL certificates for long time use.

    • Nginx with Let’s Encrypt SSL
    • Manual Setup Let’s Encrypt SSL on Ubuntu

    This tutorial will help you to install Let’s encrypt client on Ubuntu system. Also issue a free ssl certificate and configure with Apache server.

    Step 1 – Prerequisites

    Before starting work on this task, I assume you already have:

    • Running Ubuntu system with sudo privileges shell access.
    • A domain name registered and pointed to your server’s public IP address. For this tutorial, we use example.com and www.example.com, which is pointed to our server.
    • Running Apache2 server with VirtualHost configured for example.com and www.example.com for Port 80.

    Step 2 – Install Let’s Encrypt Client

    You can download the certbot-auto Let’s Encrypt client and save it in /usr/sbin directory. Use the following command to do it.

    sudo wget https://dl.eff.org/certbot-auto -O /usr/sbin/certbot-auto
    sudo chmod a+x /usr/sbin/certbot-auto
    

    Step 3 – Issue SSL from Let’s Encrypt

    Let’s Encrypt performs Domain Validation (DV) automatically with multiple challenges. Once the Certificate Authority (CA) verified the authenticity of your domain, SSL certificate will be issued.

    You don’t need to create VirtualHost for SSL/HTTPS, Let’s encrypt will create it. You only need to create VirtualHost for port 80 only.

    sudo certbot-auto --apache -d example.com  -d www.example.com
    

    Above command will prompt for an email address, which is used for sending email alerts related to SSL renewal and expiration. Also, asks a few more questions. After completion, it will issue an SSL certificate and will also create a new VirtualHost configuration file on your system.

    Step 4 – Configure SSL Auto Renew

    At the end, configure the following job on your server crontab to auto-renew SSL certificate if required.

    0 2 * * * sudo certbot-auto -q renew
    

    You may like:

      Apache – Redirect to HTTPS
      Nginx – Redirect to HTTPS

    Conclusion

    In this tutorial, you have learned to configure free ssl certificate using let’s encrypt on Apache server.

    Apache2 Let's Encrypt TLS Ubuntu
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Monitor Linux System Performance with Sysstat
    Next Article How to Secure Nginx with Let’s Encrypt on Ubuntu 18.04 & 16.04 LTS

    Related Posts

    Setup Selenium with Python and Chrome on Ubuntu & Debian

    Updated:June 20, 20224 Mins Read

    How to Setup Squid Proxy Server on Ubuntu and Debian

    Updated:June 17, 20225 Mins Read

    How to Delete a Let’s Encrypt Certificate using Certbot

    Updated:June 3, 20222 Mins Read

    Setting Up Environment Variables on Ubuntu

    Updated:May 28, 20222 Mins Read

    How to Install Apache Maven on Ubuntu 22.04

    Updated:June 2, 20223 Mins Read

    Change Screen Resolution of An Ubuntu VM in Hyper-V

    Updated:May 2, 20222 Mins Read

    3 Comments

    1. Ankit on October 1, 2019 9:27 am

      awesome tutortial
      Thanks

      Reply
    2. Gustavo Salgado on April 17, 2019 10:16 pm

      It works perfect I tried it 18.04 (bionic)

      thank you

      Reply
    3. saravanakumar on March 5, 2018 12:54 pm

      while installing let’s encrypt got this error “Cannot find a cert or key directive in /files/etc/httpd/conf/httpd-le-ssl.conf/IfModule/VirtualHost. VirtualHost was not modified”

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.