# Restore Backup - flush\_file\_lines for Apache configs

**URL:** <https://forum.virtualmin.com/t/restore-backup-flush-file-lines-for-apache-configs/109777>\
**Category:** Virtualmin\
**Created:** [March 12, 2021, 6:00pm UTC](https://forum.virtualmin.com/t/restore-backup-flush-file-lines-for-apache-configs/109777 "2021-03-12T18:00:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![exetico](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/exetico/32/2796_2.png) [@exetico](https://forum.virtualmin.com/u/exetico)\
**Post date:** [March 12, 2021, 6:00pm UTC](https://forum.virtualmin.com/t/restore-backup-flush-file-lines-for-apache-configs/109777/1 "2021-03-12T18:00:12Z")

</div>

Hi,

I just created a new VPS, where I’m trying to restore my virtual servers.

I started out by using CentOS, but I thought there was some issues with Apache, soi swapped it out with Debian 10 - just to be sure that everything was as expected.

But, after trying to restore one of my domains, it failed after the same step.

It’s failing after:

```auto
Checking restored PHP execution mode ..
.. mode FCGId OK for this system

```

The error is:

```auto
Restore failed : flush_file_lines called on non-loaded file /etc/apache2/sites-available/mydomain.com.conf

```

(In CentOS, it just reported problem with the primary `/etc/httpd/conf.d/httpd.conf` file, instead)

Here’s the CALL STACK TRACE:

```auto
FILE	LINE	FUNCTION
/usr/share/webmin/web-lib-funcs.pl	3540	WebminCore::error
/usr/share/webmin/virtual-server/feature-web.pl	1710	WebminCore::flush_file_lines
/usr/share/webmin/virtual-server/backups-lib.pl	2829	virtual_server::restore_web
/usr/share/webmin/virtual-server/restore.cgi	355	virtual_server::restore_domains
(eval 76)	6	(eval)
/usr/share/webmin/miniserv.pl	2552	(eval)
/usr/share/webmin/miniserv.pl	1000	miniserv::handle_request

```

I’ve tried to look in the code-base, but I’m not really sure what to look for: [webmin/web-lib-funcs.pl at 35108b2ba4a156ee17dec8a7eaef2728f1f180f2 · webmin/webmin · GitHub](https://github.com/webmin/webmin/blob/35108b2ba4a156ee17dec8a7eaef2728f1f180f2/web-lib-funcs.pl#L3533)

After the error has shown, the restore-process stops.

However, the ` /etc/apache2/sites-available/mydomain.com.conf` file are created, if I take a look on the server.

## It’s working fine with one domain

I’ve tried all the other virtual servers too, but they’re failing - except one.

According to the restore view, here’s the listed restored settings for the working - and failing one.

Here’s the one working just fine:

```auto

Virtual server password, description and other details
Administration user's password, quota and Cron jobs
Mail/FTP users and mail aliases
Apache webserver configuration
Webalizer configuration and schedule
Logrotate configuration for log file
Contents of server's MariaDB databases
Spam filtering
Webmin ACL files
Server's home directory and web pages
AWstats configuration file
DAV users file

```

And here’s an example of the pack if a failing restore:

```auto
Virtual server password, description and other details
Administration user's password, quota and Cron jobs
Mail/FTP users and mail aliases
Apache webserver configuration
Webalizer configuration and schedule
Apache SSL webserver configuration and certificate
Logrotate configuration for log file
Contents of server's MariaDB databases
Spam filtering
Webmin ACL files
Server's home directory and web pages
AWstats configuration file

```

The only thing I can spot, is the `Apache SSL webserver configuration and certificate` in the broken one, and `DAV users file` in the one working.

My bet it that it’s related to SSL… But… How?

**Operating system:** Debian 10, fully up-to-date fresh installed including Virtualmin, installed with the recommended script. Installed with no issues.

---

<div class="post-metadata">

**Author:** ![exetico](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/exetico/32/2796_2.png) [@exetico](https://forum.virtualmin.com/u/exetico)\
**Post date:** [March 12, 2021, 7:02pm UTC](https://forum.virtualmin.com/t/restore-backup-flush-file-lines-for-apache-configs/109777/2 "2021-03-12T19:02:43Z")

</div>

By running this, no errors shows up:

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/4/4174e4d08d93901a178ad9cc41677c842d422026.jpeg)

…

So, i rolled back my server, and started over - once again.

**Finding** :  
By running a restore-job, where I’ve selected the “Restore all features”-option, it’s failing like we’ve seen a few times.

But… Hereafter, I can go back, and run this:

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/0/0177fcb03d888047c08a227c02bd9b4d9972ecfc.jpeg)

The restore-job shows no errors at all, this time.

What the… are causing that kind of error? It is related to the Apache webserver configuration-file, and if yes, how can I figure out what’s going on?

(For my own knowledge, but also, if something should be changed in the restore-solution)

---

<div class="post-metadata">

**Author:** ![exetico](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/exetico/32/2796_2.png) [@exetico](https://forum.virtualmin.com/u/exetico)\
**Post date:** [March 12, 2021, 7:27pm UTC](https://forum.virtualmin.com/t/restore-backup-flush-file-lines-for-apache-configs/109777/3 "2021-03-12T19:27:42Z")

</div>

After a few changes, I decided to disable the BIND DNS-feature (cause I won’t use it, right now).

I tried to save the changes, and now it’s reporting:

```auto
AH00526: Syntax error on line 93 of /etc/apache2/sites-enabled/mydomain.com.conf:
Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

```

However… It doesn’t look like that the common reason, why it’s failing. Cause I have another domain, which are throwing the same error - and there’s no `php_admin_value` in the config-file.

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [March 12, 2021, 7:30pm UTC](https://forum.virtualmin.com/t/restore-backup-flush-file-lines-for-apache-configs/109777/4 "2021-03-12T19:30:20Z")

</div>

If you apply [this patch](https://github.com/virtualmin/virtualmin-gpl/commit/dcd93fa89f631c49fef5e5878a5b05dd237ded6b) and restart Webmin with `/etc/webmin/restart` command, will it help?

---

<div class="post-metadata">

**Author:** ![exetico](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/exetico/32/2796_2.png) [@exetico](https://forum.virtualmin.com/u/exetico)\
**Post date:** [March 12, 2021, 7:35pm UTC](https://forum.virtualmin.com/t/restore-backup-flush-file-lines-for-apache-configs/109777/5 "2021-03-12T19:35:54Z")

</div>

I’ve already imported all, with the work-around.

But give me 5 minutes. I’ll dump the current state, and restore to a fresh instance and include your suggestion.

One moment, and I’ll get back 👍

![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/7/79ccdd93d5e99bc972c88ea82b9943e8c2cafff4.png)

---

<div class="post-metadata">

**Author:** ![exetico](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/exetico/32/2796_2.png) [@exetico](https://forum.virtualmin.com/u/exetico)\
**Post date:** [March 12, 2021, 8:06pm UTC](https://forum.virtualmin.com/t/restore-backup-flush-file-lines-for-apache-configs/109777/6 "2021-03-12T20:06:01Z")

</div>

## Result - It’s working 🥳

![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/4/4f8df27f4dcfd04704c71bbe6692ee3bec628d09.png)

…

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/f/fe4d1ee232c3feeaf815bc1836ca911c05f77728.jpeg)

…

**Yes, it worked** 🙂 Thanks!

I found one other problem, but that’s just caused of one hack I’ve done with one of my sub-domains (and not related to this).

* * *
  

## Extra question

I’m not sure why the `php_admin_value` are in my option-files. Maybe that’s some legacy things?

I’ve removed the value from 7 of my `.conf` files now, so Virtualmin stops complaining about it.

`php_admin_value engine Off` in the config-files gives me:

```auto
AH00526: Syntax error on line 106 of /etc/apache2/sites-enabled/domainname.com.conf:
Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

```

  

* * *
  

## Extra input

I imported one VM, where the quota was more than the allowed. I must have done something odd on the old instance, cause no complains was shown on the old env. Or… Maybe `quota` wasn’t implemented. (_I unable to confirm that, cause the VM’s is burned up above the clouds… Yep… I’m one of the OVH-customers._)

But…

The import failed each time. It imported 1.3GB of data, where only 1GB was allowed.

`DAV users file` and more, couldn’t simply be imported, due to the quota was passed. But… Shouldn’t that be ignored, or at least, handled before the `public_html` file-import, to prevent this kind of annoying things? 🙂

I’m not sure if the best thing is to have a “Ignore quota while restoring”-option, of if it’s better to change the order of each step, to get `DAV users file` and more imported, before the content of `public_html` (and so)…

I fixed my situation by importing half of the configs~ including the home-folder, changed the quote, and imported the last few pieces hereafter 🙂 .

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [May 11, 2021, 8:06pm UTC](https://forum.virtualmin.com/t/restore-backup-flush-file-lines-for-apache-configs/109777/7 "2021-05-11T20:06:33Z")

</div>

Closed on May 11, 2021, 8:06pm UTC

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