How to disable DAV in Virutal server restored to Virtualmin 7.2-1?

SYSTEM INFORMATION
OS type and version Debian 10.12
Webmin version 2.001
Virtualmin version 7.2-1
Related packages DAV

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.

backup has dav enabled and so it was working for that virtual server previously. so :

  1. enable apache dav modules as on previous server/backup, before restore.
  2. restore virtual server,
  3. disable virtual server dav feature,
  4. disable dav modules from apache globally.

otherwise you can choose not to restore "Apache webserver configuration " feature, which includes dav options from original backup file.

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.

1 Like

Yes. I reported the issue some time ago in the virtualmin-git repository, suggesting a similar thing: switch to ssh.

It is a bit nasty if one restores a website with git and apache stops running.

1 Like

Yeah, that seems like something else we need to fix. There seem to be a lot of restore issues with features unavailable on the restoring host.

1 Like

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.

Responses appreciated.

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…

Ok, the issue of DAV directives in the Apache config being restored when they aren’t supported locally will be fixed in the next release.

Resolving this post as I assume that that is what should be done at this point.

To get the site back up, I had to re-enter it manually.

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