• Resolved gbh2930

    (@gbh2930)


    Wordpress 4.9.3
    Wordfence Plugin 7.0.2

    1. After installing the wordfence plugin, I see the following notice….
    “To make your site as secure as possible, take a moment to optimize the Wordfence Web Application Firewall: [Click here to Configure]”

    2. Upon clicking [click here to configure] button a window pops up with the following message…

    “We’ve preselected your server configuration based on our tests, but if you know your web server’s configuration, please select it now.”
    The preselected server configuration is Apache + suPHP but that is incorrect so I select Apache + CGI/FastCGI

    3.As prompted, I download .HTACCESS and .USER.INI and then select [Continue]

    4. I get an “Installation Successful” message window including “The changes have not yet taken effect. If you are using LiteSpeed or IIS as your web server or CGI/FastCGI interface, you may need to wait a few minutes for the changes to take effect since the configuration files are sometimes cached. You also may need to select a different server configuration in order to complete this step, but wait for a few minutes before trying. You can try refreshing this page.”

    5. I close the message window but no matter how long I wait or refresh the page, I continue to see the notice at step 1 when I would have expected it to disappear? Should this notice disappear or not? Is it an indication the setup process has not completed correctly?

Viewing 15 replies - 1 through 15 (of 20 total)
  • Hi @gbh2930,

    In order to make sure which Firewall setup you should be using:

    I also recommend this article from our documentation regarding Firewall Optimization Troubleshooting.

    Thread Starter gbh2930

    (@gbh2930)

    Thank you wfyann. The info page confirms the Server API field is “CGI/FastCGI”.

    I am reading the article you recommended.

    Thread Starter gbh2930

    (@gbh2930)

    Thank you wfyann. The info page confirms the Server API field is “CGI/FastCGI”.

    I am reading the article you recommended.

    Hi, WordFence team!

    Unfortunately, the instructions above don’t help. For SiteGround and other similar hosts that use cPanel, in the past, we could enable the optimization by adding a line like this in the PHP Variables Manager in cPanel:

    auto_prepend_file = ‘/home/username/public_html/wordfence-waf.php’

    Unfortunately, the WordFence interface has changed and this line is now MIA. Screenshot:

    https://pasteboard.co/H6SbG8M.png

    Can you please bring this line back?

    Hi @mrmatteastwood,

    Were you able to locate the “wordfence-waf.php” file?

    If so, you just need to specify the path to it in order to carry out the alternative optimization procedure.

    Hi wfyann! I did find that file, but my PHP client does not provide me with the full path to it, since, obviously, I cannot access any directories higher up in the hierarchy than my user folder. I see:

    /public_html

    From my FTP client’s address bar, I can infer the full path must be something like:

    something/something/public_html/wordfence-waf.php

    I can try a few educated guesses. But to be sure, will I need to speak to my hosting company’s customer service to find out the name of my user directory on their server?

    Hey again, I just answered my own question! The PHP Variables Manager does provide the full path, so it’s all good. Thanks for the nudge in the right direction!

    Hi @mrmatteastwood,

    Great! Thanks for letting me know.

    For anyone having the same question, the path can be found in the $_SERVER['DOCUMENT_ROOT'] variable on the Wordfence System Info page.

    Another thing I noticed that might help others with the same question:

    I have a live site at https://www.yogadelavie.ca, and a staging site at https://www.yogadelavie.ca/staging.

    At first, I only set up one php.ini file with the “auto_prepend_file” variable in the /public_html/ directory, and the copy of Wordfence installed in the /staging/ directory picked up on that too.

    It wouldn’t properly work, though, until I actually used the PHP Variables Manager to set up a php.ini in the staging folder, and pointing the variable to the wordfence-waf.php in that same folder.

    So here are my folders, and my php.inis:
    https://pasteboard.co/H7mQuOW.png

    It only makes sense in hindsight, but took me a while to realize.

    Thread Starter gbh2930

    (@gbh2930)

    Hi @wfyann,
    I have read the documentation article regarding Firewall Optimization Troubleshooting, but I am still not clear what to do next to resolve this. What should my next step be?

    Hey gbh2930, I made you a quick video. Perhaps this helps?

    Hi @gbh2930,

    If you check the “Wordfence System Info” page can you see a value assigned to the “auto_prepend_file” directive?

    Have you tried the alternative optimization procedure?

    Thread Starter gbh2930

    (@gbh2930)

    Hi @mrmatteastwood,
    Thanks, but unfortunately that video only displays a message “This video is unavailable.”

    Thread Starter gbh2930

    (@gbh2930)

    Hi @wfyann,

    auto_prepend_file = /var/www/vhosts/84/960477/webspace/siteapps/WordPress-139208/htdocs/wordfence-waf.php

    The alternative optimization procedure states:
    “3. Go to your site’s cPanel, and click the PHP Variables Manager icon”

    But I cannot find that icon?

    Crap. Fixed it, you should now be able to see it!

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Unable to optimize wordfence firewall’ is closed to new replies.