VestaCP: How to fix LetsEncrypt SSL certificate (Admin Panel)

EDIT: Method 1 still working as of 13/06/2018

Recently I have been playing around with VestaCP, an alternative to cPanel. VestaCP is a free, open source website control panel with website, email, database, and DNS functionalities built in.

The Issue (Symptoms)

Unfortunately, when I installed VestaCP and setup an SSL certificate via LetsEncrypt though the VestaCP admin panel, the certificate was not installed into the VestaCP web interface (admin panel). This meant that whenever I tried to access the VestaCP admin panel, I was presented with the following SSL error:

The Problem

This error was present because the SSL certificate generated by VestaCP and LetsEcnrypt was not installed in the VestaVP admin panel. Instead, it was only installed on the web domain as shown in the image below (please note, the domain, IP address and SSL certificate information have been removed):

The Solution

The solution, therefore, is to install the very same certificate from the web domain (shown above) into the VestaCP admin panel. The SSL certificate information for the VestaVP admin panel is located by default at the following location (for version 0.9.8):

/usr/local/vesta/ssl

The valid SSL certificate information for your domain can be found in the following location:

/home/admin/conf/web/

The files we are interested in here are “ssl.[your server domain].key” and “ssl.[your server domain].crt”.

There are two methods for solving this issue;

  1. Create a symbolic link from “/home/admin/conf/web/” (for each of the two files mentioned above) to “/usr/local/vesta/ssl”
  2. Simply copy the two files from “/home/admin/conf/web/” to “/usr/local/vesta/ssl”

The Solution – Method 1

This solution consists of creating a symbolic link from the certificate origin location to the destination location. This is the best solution since VestaCP will automatically renew LetsEncrypt certificates – a symbolic link would ensure any updates are reflected for the VestaCP admin panel.

cd /usr/local/vesta/ssl
mv certificate.crt certificate.crt_old
mv certificate.key certificate.key_old
ln -s /home/admin/conf/web/ssl.[your server domain].key /usr/local/vesta/ssl/certificate.key
ln -s /home/admin/conf/web/ssl.[your server domain].crt /usr/local/vesta/ssl/certificate.crt
sudo service vesta restart

Please be sure to replace “[your server domain]” with the domain your server is using for VestaCP.

The Solution – Method 2

This solution consists of copying the certificate key and certificate file.

Downside: Since LetsEncrypt requires certificates to be renewed every three months, you would need to perform this method each time the certificate renews.

cd /usr/local/vesta/ssl
mv certificate.crt certificate.crt_old
mv certificate.key certificate.key_old
cp /home/admin/conf/web/ssl.[your server domain].key /usr/local/vesta/ssl/certificate.key
cp /home/admin/conf/web/ssl.[your server domain].crt /usr/local/vesta/ssl/certificate.crt

sudo service vesta restart

Please be sure to replace “[your server domain]” with the domain your server is using for VestaCP.

Setting up your own website 

This post is targeted at those who wish to create their own websites from scratch (beginners-intermediate users). This guide is not intended for those with no computer background – if this is the case then I highly recommend you use an easy site builder like Wix, 1and1 or SquareSpace. This guide is intended to help those who wish to learn how to code in HTML/CSS/PHP but have no idea how to get their code online.

The advantages of building your own website opposed to using a website builder (such as Wix, 1and1, SquareSpace etc) have been covered in detail by other users. Here are a few articles/posts/links I found on the Internet which helps explain the difference between the two:

http://www.skilledup.com/articles/web-developers-vs-web-builders

https://www.quora.com/What-are-the-advantages-of-coding-your-own-website-rather-than-using-a-website-builder

https://teamtreehouse.com/community/cms-vs-hand-coding-websites

Continue reading “Setting up your own website “