ESXi > Debian > Webmin/Virtualmin (WM/VM) > one virtual server web site
[An attempt to upgrade Debian 10 to 11 did not work, and neither did several attempts to install WM/VM over Debian 11.] So, back to a fresh install of Debian 10.12 (supposed to be 10.13 but the install files an results show 10.12), and then a fresh install of WM/VM.
Before the actual restore, the option to show what will be restored gives a warning about DAV: it’s enabled in the restored files but not in the new WM/VM configuration. I don’t see an option to exclude DAV from the restore. After the restore, “Re-check and refresh configuration” produces an error:
AH00526: Syntax error on line 46 of /etc/apache2/sites-enabled/suziescollectibles.ca.conf:
Invalid command ‘DAV’, perhaps misspelled or defined by a module not included in the server configuration
Action ‘configtest’ failed.
The Apache error log may have more information.
In Webmin > Servers > Apache > Global config > Config Apache Modules, there are three “dav” lines. Disabled by default. Changing these to enabled allows the VS configuration re-check to complete without errors.
However, it appears that it would be better to disable or remove DAV from the virtual server. In Webmin, it appears that the above three lines in Config Apache Modules would work. However, something needs to be done in Virtualmin. I don’t see any reference to DAV in the current version of Virtualmin.
There’s no good reason to turn DAV on. It doesn’t work the way it needs to for a shared hosting environment, and there are better ways to interact with the filesystem on the server remotely (FTP, FTP over SSH, Virtualmin’s File Manager).
Just remove the DAV-related lines from the Apache configuration for that domain and restart Apache.
One reason to switch Apache dav modules on is that virtualmin-git depends on it, but I guess not too many people use that. Restoring a website with git causes the same problem of Apache not starting.
Is that still the case? I though Jamie had switched to using ssh as the default transport like a year or two ago…if not, it’s a planned change, and I’ll look into what happened to that plan.
Maybe we are on to something. The site has been responding with “connection refused” or “This site can’t be reached” most of the time. Leaving the link open or retrying often brings up the link. This applies to the site url and login urls for WordPress and WM/VM.
Back to the DAV issue. In /etc/apache2/sites-enabled/[website-url].conf, I deleted the following lines, starting at line 88:
Alias /dav /home/[admin-username]/public.html
<Location /dav>
DAV on
AuthType Basic
AuthName “[website-url]”
AuthUserFile /home/[admin-username]/etc/dav.digest.passwd
Require valid-user
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php7.3
RewriteEngine off
< Location>
(Space inserted in last line to get it to appear in the quote.)
After rebooting the server with systemctl, trying the site url gave the same response as noted above.
BTW, when I first deleted the lines, a day or two ago, they reappeared after a reboot, or maybe that was an Apache restart. Sorry, not sure about that. Maybe I did not delete properly. Today, however, the deleted lines remain deleted.
The current restore was done through the VM menu Backup and Restore > Restore Virtual Servers. Maybe I need to rebuild the site in Webmin/Virtualmin, then do a restore using the WordPress addon Updraft Plus. If so, I will probably try again to get VM to work on Debian 11, further delaying recovery, but going to Debian 11 now may be better than later.
There’s clearly a bug here - when restoring a domain with DAV directives in the Apache config that aren’t supported, they should be removed. I’ll look into this…