Hi,
Did you restart HHVM after modifying its /etc/hhvm/php.ini?
Did you select the single-site or multiple-site installation type?
Do I need to insert any special parameter in /etc/hhvm/php.ini?
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.
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
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: http://nintechnet.com/ninjafirewall/wp-edition/help/?htninja |
+===================================================================+
*/
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
$_SERVER["REMOTE_ADDR"] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}