Documentation

Visit Our xCloud Knowledge Base

Here is your one-stop source for in-depth articles, FAQs, and tutorials for you to excel at hosting & managing your websites.


Configure NinjaFirewall on an OpenLiteSpeed Server

NinjaFirewall is a powerful application firewall designed to enhance the security of WordPress websites, offering advanced protection against threats. By following this guide, you will learn how to enable and configure the necessary files, set up the required configurations, and ensure NinjaFirewall is properly integrated with your OLS server. 

To configure NinjaFirewall on a server running OpenLiteSpeed server, follow the steps below:

Step 1: Access Your File Manager #

Log in to your xCloud account and navigate to your siteโ€™s dashboard. In the left-hand menu, go to Access Data โ†’ File Manager.

https://xcloud.host/wp-admin/post.php?post=21993&action=edit

Step 2: Open Your File Manager #

Now, toggle on the โ€˜Enable File Managerโ€™ button to access your file manager and click on the โ€˜Launch File Managerโ€™ button to go to your file manager.

Configure NinjaFirewall

Step 3: Show Hidden Files #

In the File Manager, first go to your Profile โ†’ Settings and enable the option to โ€˜Show Hidden Filesโ€™ to view and edit configuration files like .htaccess or user.ini. After that click on the โ€˜Saveโ€™ button. 

Configure NinjaFirewall

Step 4: Create the user.ini File #

Navigate to the root directory of your WordPress site (typically /var/www/<sitename>). Check if a โ€˜.user.iniโ€™ file already exists or not. If you do not find any user.ini file then, go to the โ€˜New Itemโ€™ from the menu and select the โ€˜Fileโ€™ option. Then give the file name โ€˜user.iniโ€™ and hit on the โ€˜Create Newโ€™ button.  

Configure NinjaFirewall

Step 4: Add the Configuration Line #

Now click on the โ€˜.user.iniโ€™ file and choose โ€˜Editโ€™ button. Then add the following line to the file and click on the โ€˜Save the changesโ€™.

auto_prepend_file = โ€œ/var/www/[YOUR_DOMAIN]/wp-content/nfwlog/ninjafirewall.phpโ€

Note: Do not use the auto-prepend line suggested in the NinjaFirewall UI, as it might not work correctly on the OLS server. Use the line provided above instead using your domain.

Step 5: Restart the OLS Service #

Access the server where your site is hosted. Restart the โ€˜LiteSpeed service to apply the changes. Use the following command:

Configure NinjaFirewall

Or you can run this command using xCloud command runner.
sudo systemctl restart lsws

Read this detailed documentation to learn how to run this command:

๐Ÿ‘‰ How to Run Commands in Your Site And Server Easily with xCloud?

Step 6: Verify the Configuration #

Finally, visit the NinjaFirewall settings in your WordPress admin panel. Ensure that the firewall is active and functioning correctly.

And thatโ€™s it, this is how easily you can successfully configure NinjaFireWall on your OpenLiteSpeed server and actively protect your site.

Still stuck? Contact our support team for any of your queries. 

What are your feelings
Updated on December 19, 2024

Server Name

RAM

SSD

xCloud Provider Price/m
(For LTD users)

VULTR Price/m

DO Price/m

Newcomer

1GB

25GB

$4.50

$5.00

$6.00

Basic

2GB

55GB

$9.00

$10

$12.00

Standard

4GB

80GB

$18.00

$20

$24.00

Professional

8GB

160GB

$36.00

$40

$48.00

Business

16GB

320GB

$72.00

$80

$96.00

Server Name

RAM

SSD/NVMe

xCloud Provider Price/m
(For LTD users)

VULTR Price/m

DO Price/m

Lite

1GB

32GB

$5.40

$6.00

$8.00

Personal

2GB

88GB

$16.20

$18.00

$24.00

Growing

4GB

128GB

$21.60

$24.00

$32.00

Elite

8GB

256GB

$43.20

$48.00

$64.00

Titanium

8GB

384GB

$86.40

$96.00

$96.00

Ultimate

32GB

512GB

$172.80

$192.00

$192.00