Setup Let's Encrypt for Webmin WITHOUT Installing Web Server

2 posts / 0 new
Last post
#1 Sun, 02/26/2017 - 07:58
tpnsolutions
tpnsolutions's picture

Setup Let's Encrypt for Webmin WITHOUT Installing Web Server

Hey Folks,

I'm sure many of you like me have wondered how to simplify the deployment of Let's Encrypt certificates in Webmin, without having to install a web server to deal with the validation process.

*** The below instructions assume you have a domain resolvable to your server, as without this you won't be able to issue a certificate. ***

Recently, I was messing around with PHP, and discovered that PHP has a "simple" web server built into it's core. It requires PHP 5.4 or higher, but this should be too much to ask for since it's been readily available for most distros for quite some time.

Here's how to make use of PHP's web server functionality to deploy a Let's Encrypt certificate.

  1. From the command line (via SSH) create a directory somewhere in your filesystem.

  2. Navigate to your newly create folder, then issue the command php -S 123.123.123.123:80

*** replace "123.123.123.123" with the public IP address resolving to your server ***

  1. Navigate inside Webmin to Webmin > Webmin Configuration > SSL Encryption > Let's Encrypt

  2. Click on Request Certificate

Within a few about a minute, Let's encrypt will generate the certificate and spit back a success message. Now you can safely terminate the PHP web server by pressing Ctrl+C in your command line session.

Refresh your Webmin session in the browser, and tada! You now have an SSL enable session powered by Let's Encrypt!

*** To renew the certificate, you'll likely have to go through the same steps above, however this is still far easier than having to setup a web server like Apache just to get a certificate issued. ***

If you have questions, or feedback, feel free to post a reply to this thread.

Best Regards,
Peter Knowles
TPN Solutions

Email: pknowles@tpnsolutions.com
Sat, 03/11/2017 - 02:48
JdS

Thank you for this!

Just one tiny detail to add:

In the option "Website root directory for validation file" fill in the path to the folder that you started you PHP web server in. See items no. 1 & 2 above.

Topic locked