• Resolved arnaudriviere

    (@arnaudriviere)


    Hello,
    I cannot optimize the Wordfence Firewall, I get this message.

    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.

    And I can’t do it manually since my cPanel doesn’t have a “PHP Variables Manager” option.

    I really don’t know anything about servers, PHP and all that so if anyone could help please! (and I know there are a lot of topics covering the same issue trust me I’ve read them all but still can’t find a solution to my problem).
    Thanks guys !

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Support WFAdam

    (@wfadam)

    Hello @arnaudriviere and thanks for reaching out to us!

    Can you send a diagnostic report to wftest @ wordfence . com? You can find the link to do so at the top of the Wordfence Tools > Diagnostics page. Then click on “Send Report by Email”. Please add your forum username where indicated and respond here after you have sent it.

    I should be able to see what we need to do to optimize the firewall from the diagnostic.

    Thanks again!

    Thread Starter arnaudriviere

    (@arnaudriviere)

    Hello,
    I successfully sent the diagnostic report

    Waiting to hear back from you,
    Thank you !

    Plugin Support WFAdam

    (@wfadam)

    Thanks for sending that!

    The good news is I do see your wordfence-waf.php file has been created. Now we just need to point the WAF at it to have it optimized.

    Let’s try the easy way first. It looks like your Server API is Litespeed, so let’s do the following:
    1. Open your Wordfence > Firewall > Manage WAF page
    2. Click “Optimize the Firewall“.
    3. In the popup wizard, make sure “Litespeed” is selected.
    4. Download the backup files it suggests you download. Then complete the process.

    Now if you navigate back to this page, you should see “Remove Extended Protection” which would mean the firewall has been optimized!

    You could also send me another diagnostic and I can confirm this has been complete for you.

    Let me know how it goes! Thanks again!

    Thread Starter arnaudriviere

    (@arnaudriviere)

    Hello, thank you for your response. Unfortunately I got the same message when completing the “optimize the firewall” process :

    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.

    I sent you another diagnostic in case there’s something for you to check
    Thanks again !

    Plugin Support WFAdam

    (@wfadam)

    Thanks for sending that again! I was actually able to dig a little deeper into the diagnostics and found this. With your host, they are running on a LiteSpeed server but running it on Apache, which can sometimes happen.

    $_SERVER['SERVER_SOFTWARE'] Apache

    Let’s run through this process again but instead of selecting Litespeed in the popup wizard, select Apache + mod_php.

    Just in case it doesn’t work, you can manually do this by editing your htaccess file with the following:

    # Wordfence WAF
    <IfModule lsapi_module>
    php_value auto_prepend_file '/path/to/wordfence-waf.php'
    </IfModule>
    # END Wordfence WAF

    You will need to edit the php_value auto_prepend_file to your file path, which can be found if you select Manual Configuration in the popup wizard.

    Let me know how it goes!

    Thanks again!

    Thread Starter arnaudriviere

    (@arnaudriviere)

    Thanks for your response.

    The Apache + mod_php didn’t work, still getting the same message about changes not taking effect etc.
    And the code you sent is kind of already in my .htaccess. I have this :

    `# Wordfence WAF
    <IfModule LiteSpeed>
    php_value auto_prepend_file ‘/home/sebw7167/public_html/wordfence-waf.php’
    </IfModule>
    <IfModule lsapi_module>
    php_value auto_prepend_file ‘/home/sebw7167/public_html/wordfence-waf.php’
    </IfModule>
    <Files “.user.ini”>
    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    </IfModule>
    </Files>
    # END Wordfence WAF`

    Should I replace all this with just the bit you sent ?
    (sent you another Diagnostic, idk if anything changed)

    • This reply was modified 3 years, 5 months ago by arnaudriviere.
    Plugin Support WFAdam

    (@wfadam)

    Yes! Clear everything there from # Wordfence WAF to # END Wordfence WAF.

    Then insert this:

    # Wordfence WAF
    <IfModule lsapi_module>
    php_value auto_prepend_file '/home/sebw7167/public_html/wordfence-waf.php'
    </IfModule>
    # END Wordfence WAF

    Wait a minute or so after you save your htaccess file, then head back over to the Firewall > Manage WAF page and see if you see “Remove Extended Protection”. You can also send a diagnostic at that point for me to confirm.

    Thanks again!

    Thread Starter arnaudriviere

    (@arnaudriviere)

    Thank your for your help. But I couldn’t find “Remove Extended Protection” after modifying the htaccess file…
    I sent you a diagnostic…
    Thanks again for your time !

    Plugin Support WFAdam

    (@wfadam)

    Thanks for sending that again! It still looks to not be optimizing.

    So I would at this point recommend that you reach out to your host and ask them this:

    I need to set a PHP value auto_prepend_file on my site but it doesn’t seem to be taking effect. Can you explain how to set auto_prepend_file on my site?

    You can provide them with the htaccess code I gave you as well. They might need to set the variable somewhere on their end for it to work properly.

    Let me know what you find!

    Thanks again!

    Thread Starter arnaudriviere

    (@arnaudriviere)

    Thanks for your responde.
    My host told me I could directly access the PHP options in cPanel so I have access to a “auto_prepend_file” input (screenshot https://i.imgur.com/1aBwR65.png ).
    What am I supposed to type in there, the file directory “/home/sebw7167/public_html/wordfence-waf.php” ?

    Plugin Support WFAdam

    (@wfadam)

    Perfect! Yes! Go ahead and input that value:
    /home/sebw7167/public_html/wordfence-waf.php

    Then give it a few minutes and send me another diagnostic, hopefully, the last one!

    Thanks again!

    Thread Starter arnaudriviere

    (@arnaudriviere)

    Hey, I just did that and sent you the diagnostic.
    I hope you’ll be able to identify the problem!
    Thanks again

    Plugin Support WFAdam

    (@wfadam)

    It still doesn’t look to be set for the auto_prepend_file value.

    If that file path is correct, then you might need to ask your host why it’s not working properly.
    /home/sebw7167/public_html/wordfence-waf.php

    You could provide them this information to see if they can set it for you:
    I need to set a PHP value auto_prepend_file to point at /home/sebw7167/public_html/wordfence-waf.php on my site but it doesn’t seem to be taking effect. Can you explain how to set auto_prepend_file on my site?

    Let me know how it goes! Thanks again!

    Thread Starter arnaudriviere

    (@arnaudriviere)

    Hello again,

    My host told me that the value is set because they can see it on phpinfo. So what exactly is not working ? They asked and I don’t know what to tell them
    Thanks again

    Plugin Support WFAdam

    (@wfadam)

    Who is your host? I might have some documents on this process.

    Do you happen to see a php.ini file in the same directory as your wordfence-waf.php file? If so, it should contain the following, which would have been set by your hosts cPanel:

    ; Wordfence WAF
    auto_prepend_file = '/home/sebw7167/public_html/wordfence-waf.php'
    ; END Wordfence WAF

    The only other thing it could be then is possibly the wordfence-waf.php doesn’t have the correct information in it.

    If the above doesn’t work, could you send your wordfence-waf.php file to wftest @ wordfence . com with subject “arnaudriviere for WFADAM” and I can look over it and make adjustments.

    Thanks again!

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Can’t Optimize Firewall’ is closed to new replies.