Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To install lets encrypt SSL on the current version of cpanel, you will need to follow the steps as mentioned below:
- Enabling SSH Access
- 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.
- Installing ACME client and Composer
- 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.
- 1. Connect to your hosting account using SSH information.
- ssh username@hostname
- 2. Clone acme client from GitHub repository. Cloning can be done by executing the following command:
- git clone https://github.com/kelunik/acme-client
- 3. Access ACME client directory:
- cd acme-client
- 4. Download and install the composer:
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');";
- php composer-setup.php;
- php -r "unlink('composer-setup.php');";
- php composer.phar install --no-dev
- Generating SSL Certificate
- Once you have downloaded and installed ACME client and composer, you can proceed and generate free SSL from Lets Encrypt.
- 5. Firstly, register an account by running this command:
- php bin/acme setup --server letsencrypt --email your@email.com
- Note that you need to change your@email.com to your actual email.
- 6. The process of generating SSL certificate is straightforward. Execute the following command:
- php bin/acme issue --domains yourdomain.com:www.youdomain.com --path /home/x123011738/public_html:/home/x123011738/public_html --server letsencrypt
- Change yourdomain.com to your real domain name and x123011738 to your actual username
- (you can check it on Step 1.3).
- If certificate was issued successfully, you will see the following message:
- Requesting certificate ...
- Successfully issued certificate.
- See /home/x123011738/acme-client/data/certs/acme-v01.api.letsencrypt.org.directory/yourdomain.com
- 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.
- 7. To view the certificate and private key you must navigate to the directory where these files are stored:
- cd /home/x123011738/acme-client/data/certs/acme-v01.api.letsencrypt.org.directory/yourdomain.com
- 8. Use cat command to see contents of fullchain.pem file:
- cat fullchain.pem
- On running this command, you will be displayed both
- a) Certificate
- b) CA Bundle
- Let’s Encrypt SSL certificates are set to expire every 90 days. You can check its expiration date via SSH using the following command:
- php acme-client/bin/acme check --name yourdomain.com --serverletsencrypt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement