• Resolved johnackermann

    (@johnackermann)


    Hi —

    I just installed WordFence and can’t configure the firewall. I think I know why, but I don’t know the workaround. I get a message:

    We were unable to create the wordfence-waf.php file in the root of the WordPress installation. It’s possible WordPress cannot write to the wordfence-waf.php file because of file permissions. Please verify the permissions are correct and retry the installation.

    My guess is that this is because I am running a site-wide WordPress installation under Debian Linux, and it’s trying to write the wordfence-waf.php file in a system directory that’s not writeable by the www-data group. Is that the likely problem, and if so, is there a workaround?

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @johnackermann, thanks for your message.

    We will recommend wordfence-waf.php to be in the root of your WordPress site directory, so I wouldn’t have made the assumption it was trying to be created in the overall root of ALL sites on your environment which might be problematic with permissions. WordPress folder permissions are generally recommended to be 755, but maybe there is something I’m not fully aware of with your setup.

    We can work around the issue by having you manually create wordfence-waf.php containing the following:

    <?php
    // Before removing this file, please verify the PHP ini setting <code>auto_prepend_file</code> does not point to this.
    if( ! defined('WFWAF_STORAGE_ENGINE')) { define('WFWAF_STORAGE_ENGINE', 'mysqli'); }
    
    if (file_exists(__DIR__ . '/wp-content/plugins/wordfence/waf/bootstrap.php')) {
    	define("WFWAF_LOG_PATH", __DIR__ . '/wp-content/wflogs/');
    	include_once __DIR__ . '/wp-content/plugins/wordfence/waf/bootstrap.php';
    }

    Then for firewall optimization, make sure your .htaccess/.user.ini contains:

    ; Wordfence WAF
    auto_prepend_file = '/your/path/to/wordfence-waf.php'
    ; END Wordfence WAF

    Thanks,

    Peter.

Viewing 1 replies (of 1 total)
  • The topic ‘Can’t configure firewall — permissions’ is closed to new replies.