mass restore alias domains corrupts Apache httpd.conf

CentOS Linux release 7.7.1908 wbm-virtual-server-6.08.gpl-1.noarch

Restoring 100+ domains with many alias domains from a directory corrupts Apache httpd.conf The problem is in /usr/libexec/webmin/virtual-server/feature-web.pl restore_web function's alias restoring part.

The fix is clearing the apache config cache.

1548 &flush_file_lines($pvirt->{'file'}); 1549 + undef(@apache::get_config_cache); 1550 &$second_print($text{'setup_done'});

Please review it and include it in a next release.

Thank you.

Regards, Matyas

Status: 
Active

Comments

Ilia's picture
Submitted by Ilia on Sun, 02/09/2020 - 09:53

Assigned: Unassigned ยป

Hi,

I will pass it to Jamie for review.

Thanks for the feedback.

That shouldn't actually be needed, since the cache is updated by apache::save_directive .

What kind of corruption happens exactly?

Randomly missing directives, but only after about 100 proper VirtualHosts restored to httpd.conf. Things like ServerName missing, closing tag missing. I could reproduce it on two servers (Cloudmin cluster with VirtualminSettings/ Replicate Virtual Servers). To simplify things I saved the backups to a directory and when restoring same thing happened as from Cloudmin web interface.

With the cache clear in the alias restore section never happened since. But we can't update Virtualmin without losing the fix.

Thank you.