• We deploy to EC2 (staging) and ECS (prod). We run insider a Docker container.

    We copy the wflogs folder. How can we prevent the config.php file from being overwritten? It would seem that activation of the plugin is overwriting settings and not respecting the existing config file.

    Any insights/help would be much appreciated.

    Thanks, Theo

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @theo38, thanks for reaching out about this.

    The contents of the wflogs folder is regularly updated so it’s not uncommon for this folder to update as soon as the plugin is available.

    Wordfence does regenerate that folder with fresh data if you delete its contents or the folder entirely within 30 minutes (but usually faster), so there’s no need to include it in a deployment or backup. Logging with these files can be bypassed entirely by switching to the MySQLi storage engine, by adding the following line before the other define(... lines in wordfence-waf.php:

    define('WFWAF_STORAGE_ENGINE', 'mysqli');

    I hope that helps you out!
    Peter.

    Thread Starter Theo Pape

    (@theo38)

    Yes we already moved to using MySQL. It seems a bit odd to overwrite the config.php though – isn’t the point of that file to store the config on save?

    Plugin Support wfpeter

    (@wfpeter)

    Hi @theo38, ah thanks for clarifying,

    In terms of that file in isolation, if the user the site is running as doesn’t have permission to read the file but does have permissions to overwrite it, an update may occur soon after deployment.

    As I know you’re using MySQLi already though, the config.php shouldn’t be used at all, which is part of the reason why I suggested using it. If the plugin is still writing it, that often means the MySQLi storage engine isn’t able to run. Maybe your database details aren’t working, or you’re missing one of the constants in wp-config.php?

    Many thanks,
    Peter.

    Thread Starter Theo Pape

    (@theo38)

    Sorry, I mean that we realised we could move to using MySQLi just before you said. It’s working, I just wonder if it’s a sub-optimal approach, as you suggest in the docs.

    Ah OK, so that would make sense. We could see if there is a way to grant the permissions. Is it the whole folder that is replaced, or the individual files?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Files overwritten Docker deploy’ is closed to new replies.