[Solved] Move Webmin-created host into Virtualmin so it can have Lets Encrypt certificate

OS type and version Ubuntu Linux 18.04.6
Webmin version 2.013
Virtualmin version 7.5 Pro

I have been running Piwik (Matomo) on a server forever but only on port 80 (no SSL) Apache serves it out of /var/www/piwik directory.

I want to run it on a SSL (port 443). What’s the most straightforward way to get this using a Let’s Encrypt certificate? Many thanks.

You omitted a Virtualmin version but I’ll assume you are on Vm? :wink:
Turns out there is a little copy icon at the top of the dashboard.

But the first step is to use Virtmin to get the cert. I know it will set up the secure port when you set the site up but you’d have to check the configs to see if it does it now. But, start by using Virtualmin to get the cert. Server configuration > SSL then go to the let’s encrypt tab.

I guess my real question is how can I convert my Piwik installation to a Virtualmin host? I initially set up Piwik using Webmin (before I knew about Virtualmin). Apache serves it from /var/www/piwik

Is it as simple as using Webmin to remove the Piwik host (both port 80 & 443) and then creating the Virtualmin host pointing at /var/www/piwki?

[When searching the forums, I see that the only sensible option for enabling Let’s Encrypt is to use a Virtualmin host. All the other paths are too much work. So “all I need to do” is figure out how to move my working Piwik installation to Virtualmin.] Many thanks!

PS re: the Copy icon. That’s really cool! Thanks for the tip - I attached the info.

sea.richb-hanover.com system information
System hostname sea.richb-hanover.com (
Operating system Ubuntu Linux 18.04.6
Time on system Thursday, February 23, 2023 7:19 AM
Kernel and CPU Linux 3.10.0-1160.53.1.vz7.185.3 on i686
Processor information Intel(R) Xeon(R) CPU E3-1240 V2 @ 3.40GHz, 2 cores
System uptime 47 days, 9 hours, 19 minutes
Running processes 73
CPU load averages 0.26 (1 min) 0.19 (5 mins) 0.15 (15 mins)
Real memory 769.53 MiB used / 365.4 MiB cached / 4 GiB total
Virtual memory 0 bytes used / 256 MiB total
Local disk space 41.31 GiB used / 42.92 GiB free / 84.24 GiB total
Package updates All installed packages are up to date
Webmin version 2.013
Usermin version 1.861
Virtualmin version 7.5 Pro
Authentic theme version 20.13
Path to Perl /usr/bin/perl
Python version 3.6.9
Path to Python /usr/bin/python3
Postfix version 3.3.0
Mail injection command /usr/lib/sendmail -t
Apache version 2.4.29
PHP versions 8.2.3
Logrotate version 3.11.0
MySQL version 5.7.41-0ubuntu0.18.04.1
Virtual servers 8
DNS domains 0
Virtual websites 8
SSL websites 7
Mail domains 0
Databases 6
Mail/FTP users 6
Mail aliases 3

Answering my own question:

Yes. Almost. Here’s what I did:

  • Delete the old (webmin-created) piwik.richb-hanover.com (the contents of /var/www/piwik remain)
  • Create a new Virtualhost with Virtualmin using “Initial website content” of default template and “hello world” as initial content . This goes into a newly created home directory /home/piwik
  • Set up the Let’s Encrypt certificate as usual.
  • cp -R --preserve /var/www/piwik /home/piwik/public_html (Copy everything into the new directory. Make sure to copy into the public_html directory…)
  • rm public_html/index.html (to get rid of the default “initial website content”)
  • (probably) rm -rf /var/www/piwki after I’m completely sure it worked as desired.

I don’t know if this is “the right way” to do it, but it seems to have worked for me.


This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.