VirtualHostX Pro v2020.04 was released on March 15, 2020 and includes a new feature that will let you use Certbot to provide trusted SSL certificates for production websites you host with VHX.
Please Note: This is an advanced topic. I've done my best to make this feature simple to setup and use, but SSL certificates are notoriously tricky business. I'm happy to offer assistance when possible, but please exercise caution if you're new to this sort of thing.
First things first: This feature requires that
cerbot is installed in the virtual machine. If you are upgrading from an earlier version of VirtualHostX Pro, you can either let the app install
certbot for you or you can do so yourself.
(If you are a new user or first installed VHX on or after March 15, 2020, your virtual machine is already setup and no action is required on your part.)
VirtualHostX can automatically install
certbot for you. This process may take some time depending on your internet connection as it needs to download approximately 1GB of data.
Please Note: This automatic setup process will destroy the virtual machine. Your websites' files will remain untouched. However, you will lose any MySQL databases inside the virtual machine. If you have data you don't want to lose, please follow the manual installation instructions in the next section instead.
To automatically install
certbot, follow these steps:
If you're running a version of VirtualHostX Pro installed prior to March 15, 2020 and want to maintain your virtual machine customizations - including your MySQL databases - you can follow these steps to install
sudo apt install -y certbot python-certbot-apache
certbot has been installed, you can configure a website to use a real SSL certificate.
First, make sure the website you want to configure is accessible and working on the public internet. The domain name you want to use for your website should be entered into the "Website Name" field in VHX.
Note: Web browsers will expect your web server to be running on port 80. Either use the "Bind to Ports 80..." command under the "Web Server" menu, or configure your network to forward public port 80 to port 8080 on your Mac.
After you've confirmed your website is publicly accessible, click the Terminal button the app's toolbar to open a command line into the virtual machine. You can run
certbot and install an SSL certificate by running this command:
If this is your first time running
certbot, you'll need to answer a few questions first.
certbot asks you which domain name you'd like to configure, enter the number for the domain you want. Important: Due to the way VirtualHostX works, please ONLY CHOOSE ONE domain name at a time. If you need to setup additional domain names, configure them separately one after another.
certbot finishes issuing your SSL certificate, you need to inform VirtualHostX of this change.
🎉 Your website should now be available securely over HTTPS.
If it's not or if the web server is no longer responding, it's possible you may have a misconfiguration in your web server settings. You can check for errors by choosing "Run Config Test..." from the "Web Server" menu.