Internet

How to Install Let’s Encrypt Free SSL Certificate for Your Websites on Your ServerPilot Account

How to Install Let’s Encrypt Free SSL Certificate for Your Websites on Your ServerPilot Account

Bash script to generate and install Let’s Encrypt certificate for your websites on your free/paid ServerPilot account. Currently, the only easy way to add SSL to your ServerPilot-powered websites is by subscribing to the paid plan.

Purchase an SSL Certificate on ServerPilot

How to Install Let's Encrypt Free SSL Certificate for Your Websites on Your ServerPilot Account

How to install

  • ssh to your server, sudo su to act as root
  • Copy sple.sh to your /usr/local/bin folder
  • Kindly check update :  sudo apt-get update
  • cd /usr/local/bin && wget https://raw.githubusercontent.com/lesaff/serverpilot-letsencrypt/master/sple.sh
    
  • Run sudo chmod +x sple.sh to make it executable

How to use

  • Run sple.sh anywhere from your console as root

Why?root

This script updates/create script in the /etc/nginx-sp that requires root access

IF things go wrong

  • Check /var/log/letsencrypt for detailed error messages
  • ssh to your sp server as root
    cd /etc/nginx-sp/vhosts.d
  • List all the ssl config files
    ls *ssl*
  • Delete the <appname>.ssl.conf that is causing the problem

Restart Nginx sudo service nginx-sp restart

Schedule auto renewal

Add the following to your crontab (crontab -e)

For Ubuntu 14.04

0 */12 * * * /usr/local/bin/certbot-auto renew --quiet --no-self-upgrade --post-hook "service nginx-sp reload"

For Ubuntu 16.04

0 */12 * * * letsencrypt renew && service nginx-sp reload

How to Install Let's Encrypt Free SSL Certificate for Your Websites on Your ServerPilot Account

Final Coding

  • /usr/local/bin
  • sudo apt-get update
  • wget https://raw.githubusercontent.com/lesaff/serverpilot-letsencrypt/master/sple.sh
  • sudo chmod +x sple.sh
  • sple.sh
  • 0 */12 * * * letsencrypt renew && service nginx-sp reload

Notes

Via
Serverpilot
Source
GitHUBLicenseSple.Sh

Sk Nasir Ali

I'm an Indian Blogger, Youtuber, Photographer, Web Designer & Small Businessman. My Motive Behind Creating This Website & Youtube Channel Was to Make Easy to Understand, Tech Related Any Article in our Language, & I Wanted Each & Every Individual Whoever is Interested in Technology to be Able to Understand it in The Easiest Possible Way.

Related Articles

Leave a Reply

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

Close

Adblock Detected

Please consider supporting us by disabling your ad blocker