Advertisement
Tyrsdei

Lets Encrypt

May 28th, 2018
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1.  
  2. To install lets encrypt SSL on the current version of cpanel, you will need to follow the steps as mentioned below:
  3.  
  4. Enabling SSH Access
  5.  
  6. SSH access is required to install SSL on shared hosting servers. By default, it’s enabled, and you can access it from CPanel. You just need to put in the host name, username and password as provided under Admin details of your hosting package.
  7.  
  8. Installing ACME client and Composer
  9.  
  10. We will use ACME client written in PHP and composer to generate Let’s Encrypt SSL certificate. First, you must connect to your hosting account via SSH and download all required components.
  11.  
  12. 1. Connect to your hosting account using SSH information.
  13. ssh username@hostname
  14.  
  15. 2. Clone acme client from GitHub repository. Cloning can be done by executing the following command:
  16. git clone https://github.com/kelunik/acme-client
  17.  
  18. 3. Access ACME client directory:
  19. cd acme-client
  20.  
  21. 4. Download and install the composer:
  22.  
  23. php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');";
  24.  
  25. php composer-setup.php;
  26.  
  27. php -r "unlink('composer-setup.php');";
  28.  
  29. php composer.phar install --no-dev
  30.  
  31. Generating SSL Certificate
  32.  
  33. Once you have downloaded and installed ACME client and composer, you can proceed and generate free SSL from Lets Encrypt.
  34.  
  35. 5. Firstly, register an account by running this command:
  36. php bin/acme setup --server letsencrypt --email your@email.com
  37. Note that you need to change your@email.com to your actual email.
  38.  
  39. 6. The process of generating SSL certificate is straightforward. Execute the following command:
  40. php bin/acme issue --domains yourdomain.com:www.youdomain.com --path /home/x123011738/public_html:/home/x123011738/public_html --server letsencrypt
  41.  
  42. Change yourdomain.com to your real domain name and x123011738 to your actual username
  43. (you can check it on Step 1.3).
  44.  
  45. If certificate was issued successfully, you will see the following message:
  46. Requesting certificate ...
  47. Successfully issued certificate.
  48. See /home/x123011738/acme-client/data/certs/acme-v01.api.letsencrypt.org.directory/yourdomain.com
  49.  
  50. ACME client has now generated certificate and private key files. Unfortunately, installation cannot be done via SSH due to security restrictions. Therefore, you first need to manually copy certificate and private key files to your computer. It can be done using simple copy / paste method.
  51.  
  52. 7. To view the certificate and private key you must navigate to the directory where these files are stored:
  53.  
  54. cd /home/x123011738/acme-client/data/certs/acme-v01.api.letsencrypt.org.directory/yourdomain.com
  55.  
  56. 8. Use cat command to see contents of fullchain.pem file:
  57. cat fullchain.pem
  58.  
  59. On running this command, you will be displayed both
  60. a) Certificate
  61. b) CA Bundle
  62.  
  63. Let’s Encrypt SSL certificates are set to expire every 90 days. You can check its expiration date via SSH using the following command:
  64. php acme-client/bin/acme check --name yourdomain.com --serverletsencrypt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement