• Resolved pyoorkate

    (@pyoorkate)


    I am in the process of installing wordfence on a WordPress site running in a Google Cloud VM instance. The first part of the install went smoothly, Optimizing the Wordfence Firewall appeared to appropriately detect the system, but then completing that process led to an inaccessible site with a 500 Internal Server Error.

    I recreated the .htaccess file without the auto_prepend_file statements, which has made the site functional again, but would like to get that feature working.

    Do you have any recommendations?

    Thanks!

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

    (@wfadam)

    Hello @pyoorkate and thanks for reaching out to us!

    Sometimes setting up Wordfence on Google VM can be tricky at first.

    Let’s start with a diagnostic. 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.

    Thanks!

    Thread Starter pyoorkate

    (@pyoorkate)

    Unfortunately, when I click send e-mail it fails – reporting “There was an error while sending the email.”

    Plugin Support WFAdam

    (@wfadam)

    I know with Google VM you are generally on your own for setting up SMTP / WP_mail as they don’t provide a ton of assistance.

    On the diagnostic page, click “Export” and then could you email me at wftest @ wordfence . com the txt file it exports. If you could make the subject line your forum username.

    Thanks!

    Thread Starter pyoorkate

    (@pyoorkate)

    I’ve added the SMTP sender – and theoretically at least, it’s sent the diagnostic report! ??

    Plugin Support WFAdam

    (@wfadam)

    Perfect! Thank you for sending that @pyoorkate

    The first step we will need to take is to alter an apache config file to AllowOveride All.

    Open your wordpress.conf file and add:

    <Directory /var/www/html>
    Options -Indexes
    AllowOverride All
    </Directory>

    Navigate and check the config files in /etc/apache2/sites-available/ if one of those has its own AllowOverride set to a different value for /var/www/html, it would need to be changed in that file instead.

    Once you have this setup, you should be able to optimize the firewall as normal. Open Wordfence > Firewall > Optimize the Firewall and select Apache + mod_php in the popup to complete.

    Let me know how it goes or if you have any questions!

    Thanks!

    Thread Starter pyoorkate

    (@pyoorkate)

    Hi,

    I have two wordpress.conf files –
    /etc/apache2/sites-available/wordpress.conf
    /etc/apache2/sites-enabled/wordpress.conf

    I edited both of them to include:
    <Directory /var/www/html>
    Options -Indexes
    AllowOverride All
    </Directory>

    Then allowed wordfence to modify the .htaccess file and unfortunately returned to the 500 – Internal Server Misconfiguration error. Returning .htaccess to it’s previous configuration allows me to access the site, but obviously then I don’t have the firewall enabled…

    Do you have any other thoughts, or did I miss something I need to edit first?

    Thanks!

    • This reply was modified 4 years, 1 month ago by pyoorkate.
    Plugin Support WFAdam

    (@wfadam)

    Let’s make sure that the other portion is correct as well.

    So after you input that code into the conf files and then restart apache, let’s set the rest up manually.

    Before we do this next step, back up your current htaccess file. Make sure nothing # Wordfence WAF currently exists in it.
    Make sure anything

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

    Make sure to adjust the path to your path of the wordfence-waf.php which should be in your root directory along side your htaccess file.

    Let me know how this does!

    Thanks!

    Thread Starter pyoorkate

    (@pyoorkate)

    I’d actually forgotten to restart apache after updating .htaccess – sorry! Doing that seems to have fixed it ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Google Cloud / Wordfence Firewall Config’ is closed to new replies.