Hi
I am using Ninjafirewall plugin on my WordPress and it’s asking me put the rule into to php.ini file but I am not sure which file to edit.
Log in to your Openlitespeed admin dashboard, click on “Virtual Host”, select your domain, add the following instructions to the “php.ini Override” section in the “General” tab, and restart Openlitespeed:
php_value auto_prepend_file "/home/www.optimizewp.net/public_html/wp-content/nfwlog/ninjafirewall.php"
Please help
Thanks
Ramdhan Mubarak @webmasteroffers
Using OLS you use List Websites → optimizewp.net → Manage → vHost
Add the phpIniOverride
or use it if its there
phpIniOverride {
php_value auto_prepend_file "/home/www.optimizewp.net/public_html/wp-content/nfwlog/ninjafirewall.php"
}
Sometimes you have to reboot the server or restart php for you to see changes have been effected
Thank you for your support. However, it didn’t work
Oops! Full WAF mode is not enabled yet.
Make sure you followed the instructions and restarted Openlitespeed.
I put that code into vHost, save and reboot the server. I also tried with .htaccess file from this topic Cannot activate Full Waf ! | WordPress.org
But still not working.
Please help
Try add the directive to .htaccess using Rewrite Rules
Go to List websites → optimizewp.net → ReWrite Rules
Yes, I did but didn’t work as well
# BEGIN NinjaFirewall
<IfModule Litespeed>
php_value auto_prepend_file "/home/www.optimizewp.net/public_html/wp-content/nfwlog/ninjafirewall.php"
</IfModule>
# END NinjaFirewall
Try fix file permissions under that path
I checked and all files and folders have the same owner - user:group (wwwop9555:wwwop9555), 644 for files
So I am not sure what file permissions you mention.
Go to List Websites → optimizewp.net → File Manager → Fix Permissions
Thank you for your reply. Clicked “Fix Permissions” but no luck
Go to WebAdmin Console → Virtual Host optimizewp.net → External App
Add it as instructed here:
https://community.cyberpanel.net/uploads/default/original/1X/7cab687cbaabf4a727b6ee68103a9ee8e5ae7a32.png
Try add this
PHPRC=/home/domain.com/public_html
in ext app env , like so:
[image]
then copy everything in /usr/local/lsws/lsphpXX/etc/php.ini into /public_html/php.ini
after that , customize your values in public_html/php.ini
[image]
I got it working, I did steps below:
Set the OLS password and access to OpenLiteSpeed webadmin via port 7080 (need to open this port in firewall)
Login to webadmin and add to **Admin Console > Configuration > Server > External App
Then: Under Environment section
**PHPRC=/home/$VH_NAME/public_html
Save it and restart OLS.
Thank you again for your support.
p/s: Of course, you need to add to vHost file the code look like below too.
phpIniOverride {
php_value auto_prepend_file "/home/www.optimizewp.net/public_html/wp-content/nfwlog/ninjafirewall.php"
}
Replace www.optimizewp.net with your domain.
2 Likes
system
Closed
March 27, 2023, 2:19pm
15
This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.