letsencrypt certbot issue “letsencrypt or certbot was not found on your system” Apache on CentOS/RHEL 7

letsencrypt certbot issue “letsencrypt or certbot was not found on your system”

  1. SSH into the serverSSH into the server running your HTTP website as a user with sudo privileges.
  2. Enable EPEL repoYou’ll need to enable the EPEL (Extra Packages for Enterprise Linux) repository.
    Follow these instructions at the Fedora wiki to enable EPEL.

    enable EPEL

  3. Enable the optional channelIf you’re using RHEL or Oracle Linux, you’ll also need to enable the optional channel. On EC2, RHEL users can enable the optional channel by running the following command, substituting your EC2 region for REGION in the command:
    1. yum -y install yum-utils
    2. yum-config-manager –enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
  4. Install CertbotRun this command on the command line on the machine to install Certbot.
    sudo yum install certbot python2-certbot-apache
  5. Choose how you’d like to run Certbot
    • Either get and install your certificates…Run this command to get a certificate and have Certbot edit your Apache configuration automatically to serve it, turning on HTTPS access in a single step.
      sudo certbot --apache
    • Or, just get a certificateIf you’re feeling more conservative and would like to make the changes to your Apache configuration by hand, run this command.
      sudo certbot certonly --apache
  6. Set up automatic renewalWe recommend running the following line, which will add a cron job to the default crontab.
    echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew" | sudo tee -a /etc/crontab > /dev/null
  7. Confirm that Certbot workedTo confirm that your site is set up properly, visit https://yourwebsite.com/ in your browser and look for the lock icon in the URL bar. If you want to check that you have the top-of-the-line installation, you can head to https://www.ssllabs.com/ssltest/.

Leave a Reply

Your email address will not be published. Required fields are marked *