This patch fixes comments before skipped `IfModule`, `IfDefine`, and `IfVersion` blocks being attached to the next parsed directive.
For example:
```apache
# SSL-only settings
<IfModule mod_ssl.c>
SSLEngine on
</IfModule>
ServerName example.test
```
When `mod_ssl` was unavailable, Webmin attached `# SSL-only settings` to `ServerName`. Deleting `ServerName` could then remove the wrong line and produce:
```apache
# SSL-only settings
<IfModule mod_ssl.c>
SSLEngine on
```
This fix clears comments belonging to skipped conditionals. Deleting `ServerName` now leaves the complete `IfModule` block unchanged.
This PR fixes incorrect line numbers when Apache directives contain nested blocks.
It preserves comments during rewrites and correctly tracks every nested line.
This prevents Virtualmin from corrupting custom Apache configurations.
Fixes: https://github.com/virtualmin/virtualmin-gpl/issues/1153
* Note: Bring the Apache module to parity with the Nginx module's Debian
sites-available/sites-enabled handling: list disabled vhost files
alongside active ones, toggle their state via symlink with apachectl
configtest rollback, and delete VirtualHost blocks from inactive files.
When Virtualmin manages a vhost, defer enable/disable to Virtualmin's
own forms instead of touching the symlink directly.
https://forum.virtualmin.com/t/enable-disable-toggle-buttons-in-ngnix-module/137238/4?u=ilia