• Resolved Stephane PISKORZ

    (@stefanp44)


    Hi,

    Recently, the host I use for most of my websites (O2Switch) updated something on their servers and I need to re-optimize the firewall. The commands inside the htaccess file used to work but not anymore. For single websites, I used the cPanel auto_prepend.

    However, in some cases, my clients have 2 sites in different folders on the same host. As the auto_prepend works for the whole server, what would be the trick to add 2 paths to the auto_prepend file, one for each firewall?

    Thanks for your time and support.

    Regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support wfphil

    (@wfphil)

    Hi @stefanp44

    I would like to have a look at your Wordfence diagnostics reports for the two sites that you mentioned.

    Please go to the top of the “Diagnostics” tab on the Wordfence “Tools” page. There will be a “SEND REPORT BY EMAIL” button to send the diagnostics report. Enter wftest [at] wordfence [dot] com as the email and @stefanp44 as the forum username please.

    Once you have emailed me the diagnostics reports can you reply here to let me know that they have been sent. This is important in the unlikely event that your installations of WordPress is having an issue with sending mail.

    Thread Starter Stephane PISKORZ

    (@stefanp44)

    Hi @wfphil

    I sent you both reports, one for this site (https://www.lesparambitieux.com/) and the second one (https://versuneparentalitepositive.com/): both are hosted on the same host (different folders) and as I was saying above, I can only add one php file to auto_prepend file.
    I’m grateful you can have a look at it, thanks!

    Plugin Support wfphil

    (@wfphil)

    Hi @stefanp44

    Thank you for sending the reports.

    On versuneparentalitepositive[.]com the firewall is optimized correctly

    On lesparambitieux[.]com that site is incorrectly running under the firewall for versuneparentalitepositive[.]com

    On the lesparambitieux[.]com Tools >> Diagnostics page expand the Wordfence Firewall Current WAF configuration section.

    Copy the file path from the wordfence-waf.php path line. It will look like this but I have redacted the server user:

    /home/XXXXX/public_html/wordfence-waf.php

    In the .htaccess file in the public_html directory add this code with the correct file path, as the code below has the server user redacated.

    # Wordfence WAF
    <IfModule lsapi_module>
    php_value auto_prepend_file '/home/XXXXX/public_html/wordfence-waf.php'
    </IfModule>
    # END Wordfence WAF
    Plugin Support wfphil

    (@wfphil)

    Hi @stefanp44.

    ^^^ Once that has been implemented then send a new Wordfence diagnostics report for lesparambitieux[.]com

    Please go to the top of the Diagnostics tab on the Wordfence Tools page. There will be a SEND REPORT BY EMAIL button to send the diagnostics report. Enter wftest [at] wordfence [dot] com as the email and @stefanp44 as the forum username please.

    Once you have emailed me the diagnostics reports can you reply here to let me know that they have been sent. This is important in the unlikely event that your installations of WordPress is having an issue with sending mail.

    Thread Starter Stephane PISKORZ

    (@stefanp44)

    Hi @wfphil,

    Thank you for your reply. I checked the Diagnotics tab in Wordfence and copied and the path to the wordfence-waf.php file, but when I opened the .htaccess file, I could see that the code you provided me with was already there.

    Never mind though, I contacted the host company to try and understand how to set the firewall up if my client has two or more websites on the same server, but different directories. They provided me with 2 solutions :
    – either I create from scratch a php.ini file that would include the auto_prepend_file option
    – or I can create what they call a “separate universe” on that server, and this would allow me to use a different version of PHP for instance.

    I elected the latter, am going to test this afternoon, but I feel really confident about it, so I guess this topic could be marked as solved.

    Thanks for your time, have a nice day!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘2 websites, same host, auto_prepend file’ is closed to new replies.