How to Secure Webmin with a free Let's Encrypt SSL Certificate for CentOS

Kevin J DonovanAugust 22nd 2021, 9:06

Because CentOS does not make the same assumptions as Debian, installing a trusted SSL certificate on it can be tricky.The easiest way to fix certificate errors from Webmin is by following these instructions:

Step 1 : Install the Apache Web Server first.In order to use the Let's Encrypt service, you must place a file in your web server’s document root.From the Webmin homepage, click "Un-used Modules" and then on the "Apache Webserver".

Step 2 : Install the Apache Web Server by clicking "Install Now".

Step 3 : When using Webmin, it will tell you the packages to download and install. To install the packages, click "Install Now" again. Now you will need to configure the Apache Web Server's secure virtual host - the settings in which one can configure the website to respond to requests for an HTTPS version of the website.

Step 4 : Click "Refresh Modules" in order to rescan for web-related modules that should be active. Once the scan is complete, click on "Servers," then "Apache Webserver."

Step 5 : In order to access the secure version of your website, click on the globe.

Step 6 : At the bottom of the Configuration, in the Virtual Server Details section, provide your hostname (mine is example.devtutorial.io). The Document Root should be changed from "Default" to /var/www/html. To modify the configuration of Apache, click "Save."

Step 7 : When finished configuring, click "Start" or the "Apply Changes" button found in the upper right.

Step 8 : The final port that must be opened is 443. This can be done in the same way as you did to open port 10000. The command is firewall-cmd --zone=public --add-port=443/tcp and then firewall-cmd --runtime-to-permanent to enable the change to be permanent.

firewall-cmd --zone=public --add-port=443/tcp
firewall-cmd --runtime-to-permanent

Step 9 : We've finally created a secure connection for the server. In your browser, go to Webmin's menu and choose "Webmin Configuration"

Step 10 : Make sure SSL encryption is enabled.

Step 11 : Choose "Let's Encrypt" from the drop-down menu. Let's Encrypt is a free service that installs a browser-trusted SSL certificate on your computer.

Step 12 : Restart Webmin and reload the page.

Step 13 : Reload your Webmin login page and you should not encounter any more certificates errors.