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.
- ssh to your server,
sudo suto act as root - Copy
sple.shto your/usr/local/binfoldercd /usr/local/bin && wget https://raw.githubusercontent.com/lesaff/serverpilot-letsencrypt/master/sple.sh - Run
sudo chmod +x sple.shto make it executable
- Run
sple.shanywhere from your console as root - Follow the on-screen instructions
This script updates/create script in the /etc/nginx-sp that requires root access
- Check
/var/log/letsencryptfor detailed error messages - ssh to your sp server as
root
cd /etc/nginx-sp/vhosts.d - List all the
sslconfig files
ls *ssl* - Delete the
<appname>.ssl.confthat is causing problem
Restart nginx
sudo service nginx-sp restart
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
For Ubuntu 18.04
0 */12 * * * letsencrypt renew && service nginx-sp reload
- This script assumes that you did not change your default ServerPilot installation folder
- When entering your domain names, please list the primary root domain name first
- To force HTTPS on your website, please follow instructions here
- To redirect www to non-www or non-www to www on your website, please follow instructions here
- Obey/observe the rate limits. Read the full documentation on the Let's Encrypt website for more information.