• Resolved miguelkennedy

    (@miguelkennedy)


    Hello,

    I’m on nginx + hhvm

    I tried installing the firewall with every single server combination but I get the following error:

    NinjaFirewall fatal error: Unable to communicate with the firewall. Please check your PHP INI settings. Review your installation, your site is not protected.

    HTTP server : nginx/1.9.12
    PHP version : 5.6.99-hhvm
    PHP SAPI : SRV (HHVM detected)

    auto_prepend_file : none
    NinjaFirewall detection : NinjaFirewall is not loaded

    Loaded INI file : none
    user_ini.filename : none
    user_ini.cache_ttl : none
    User PHP INI : none found

    Any help would be greatly appreciated

    https://www.ads-software.com/plugins/ninjafirewall/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author nintechnet

    (@nintechnet)

    Hi,

    Did you restart HHVM after modifying its /etc/hhvm/php.ini?
    Did you select the single-site or multiple-site installation type?

    Thread Starter miguelkennedy

    (@miguelkennedy)

    Do I need to insert any special parameter in /etc/hhvm/php.ini?

    Plugin Author nintechnet

    (@nintechnet)

    Yes, you need to add the firewall directive ( auto_prepend_file… etc), as indicated in this article:
    Installing NinjaFirewall with HHVM (HipHop Virtual Machine)

    When you install NinjaFirewall, select “Other webserver + HHVM“, do not select “Nginx” and follow the instructions.

    Thread Starter miguelkennedy

    (@miguelkennedy)

    Thank you so much for the time you took to provide me with support! Managed to get it working.

    My server uses HHVM but if HHVM fails it fallsback to PHP7 and if that fails it fallsback to PHP5.6…

    The firewall is working in all versions of PHP and HHVM… nice ??

    One last question… Will the firewall work with varnish? I’m using varnish to cache full pages…

    Nginx is in front of varnish acting as a proxy so https request -> nginx -> varnish -> nginx -> browser

    Plugin Author nintechnet

    (@nintechnet)

    If you use a reverse proxy, you will need to tell the firewall which IP it should use. To do that, you can use the “.htninja” configuration file.

    If your visitors real IP is forwarded into the HTTP_X_FORWARDED_FOR variable, you will need to use this code:

    <?php
    /*
     +===================================================================+
     | NinjaFirewall optional configuration file                         |
     |                                                                   |
     | See: https://nintechnet.com/ninjafirewall/wp-edition/help/?htninja |
     +===================================================================+
    */
    if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
       $_SERVER["REMOTE_ADDR"] = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘NinjaFirewall fatal error’ is closed to new replies.