Archive

How to enable full/advanced WordFence protection on OpenLiteSpeed

Website security is always a fundamental and important part of any website especially WordPress. Today we will see how to enable full/advanced Wordfence protection on OpenLiteSpeed.

If you are using LiteSpeed Enterprise you don’t need to do anything as it is fully Apache compatible so Wordfence full protection will work out of the box. So you can stop now and enjoy your coffee.

However, if you are using OpenLiteSpeed then go ahead, make sure to use OpenLiteSpeed with CyberPanel, and ease your life.

What is WordFence?

Wordfence is one of the most popular WordPress scanner and firewalls. Wordfence comes in both free and premium versions. Wordfence has enough features to secure your websites like endpoint firewall, malware scanner, malicious IP addresses detection, 2FA, and all. In short, Wordfence is the most comprehensive WordPress security solution available. Wordfence is enough to secure your site.

Why do we need to configure OpenLiteSpeed for full Wordfence protection?

Setting up WordFence is a bit tricky in the case of OpenliteSpeed. With OpenLiteSpeed, you have to do some manual settings. In this article, we will discuss how to configure Wordfence with OpenliteSpeed to enable advanced firewall options.

Enable full Wordfence protection on OpenLiteSpeed:

  1. Install Wordfence on your WordPress site.
  2. Edit Vhost Configuration for Wordfence.
  3. Enable full Wordfence protection with CyberPanel.

Install Wordfence on your WordPress site:

The installation of Wordfence on your WordPress site is just like the installation on any plugin. Follow along the steps to install Wordfence.

Setp 1: Install Wordfence Plugin:

To install WordFence on your WordPress site first log in to your admin dashboard:

Go Plugins->add New

advanced wordfence protection on openlitespeed

Now search Wordfence in the search bar, You will receive the results for Wordfence select the first one (The one with the Wordfence logo) and Click install.

image 64

Setp 2: Setup Wordfence Plugin:

Once installation is done click Activate to activate the plugin:

image 65

After activation, they will ask you for an email address where they sent you emails regarding your website. Provide your email, click yes if you want to receive emails, check the box for agreement and press continue.

image 67

If you have a premium version enter the key here otherwise click on thanks and use the free version.

image 68

Now your Wordfence is installed and good to go. You can see the Wordfence on the left menu. When you click that you will see a notice to configure full/extended Wordfence protection.

image 69

Once you click the configuration a prompt appears that asks to download the .htaccess file. Click on download and press continue.

image 70

In the case of LiteSpeed Ent. configuration is done out of the box but in the case of OpenLiteSpeed, we’ve to perform some additional steps that we will discuss below. I found an official video guide for you to install Wordfence you can check that also.

Edit Vhost Configuration for Wordfence:

For OpenLiteSpeed you have to configure the Wordfence to enable Advanced WordPress Protection. Without setting these configurations to OpenLiteSpeed you can see that there is the Basic WordPress Protection.

image 71

To enable the advanced protection you have to access the OpenliteSpeed web server dashboard by navigating https://<your_ip>:7080. In the OpenLiteSpeed web, server Dashboard go to the VHost -> General

image 72

Go the end of page you will find the php.ini overwrite click the edit button.

image 73

add this to php.ini overwrite

php_value auto_prepend_file /path/to/wordfence-waf.php

Most Common path if you created site from cyberpanel

php_value auto_prepend_file /home/example.com/public_html/wordfence-waf.php

If you added the domain with CyberPanel then first you have to find the path of the wordfence-waf.php file. After adding this graceful restart the OpenLiteSpeed with this server did not get the changes.

image 74

Once done go back to your WordPress site and check the firewall you can see the Extended Protection level there.

image 75

Instead of doing this from the OpenLiteSpeed, you can install CyberPanel on your OpenLiteSpeed server, and then there is an easy way to do this. I will describe that in the next step.

Enable advanced firewall with CyberPanel.

When you have the CyberPanel installed on your server to manage your site you can follow the guide stated above but in this part of the article, I will tell you a simple way to do this using CyberPanel. To enable an extended or advanced level of protection using CyberPanel, you have to log in to CyberPanel using your credentials.

From you CyberPanel Dashboard go to the Websites ->list websites

image 76

You can see all of your websites there Click on the Manage button. To open the website dashboard.

image 77

Once the manage Dashboard for the web site is opened go to the configuration part and click the VHost

image 78

Go to the php.ini section

image 79

Add the following line to enable the extended protection.

php_value auto_prepend_file /home/example.com/public_html/wordfence-waf.php 

Now your extended protection is enabled .

image 81

Follow US on Facebook / Twitter  for update.

How to configure Redis Object caching for WordPress on CyberPanel

Redis is open-source software that is used as a database cache. At times when MySQL becomes a bottleneck for your WordPress installation due to heavy queries, Redis can help reduce that load by using in-memory data structure storage. In this article, we will see how to configure Redis Object Caching for WordPress on CyberPanel using the Redis plugin.

CyberPanel is one of the emerging and popular choices among web hosting control panels and with its current new feature timeline, CyberPanel developers are introducing more and more features into it. With a team that is very quick with updates and bug fixes, CyberPanel is becoming one of the first choices for a free hosting panel.

Currently, CyberPanel stable version is v2.0.3, and the CyberPanel team is about to launch the next version very soon. The v2.0.3 version includes very exciting features and one of those features which CyberPanel has introduced is the Redis Application installation with PHP extension.

Table Of Content:

  1. How to install Or upgrade the CyberPanel :
  2. Install Redis and Redis PHP extension on CyberPanel.
  3. Install Redis Plugin on WordPress.
  4. Redis setup with Redis WordPress plugins.
  5. Benchmarks

How to install Or upgrade CyberPanel:

If you are looking for how to install CyberPanel? Then you are in the right place and if you are looking for how to get the latest version of CyberPanel then this article will tell you how you can upgrade CyberPanel to the latest version.

How to install CyberPanel:

Honestly, CyberPanel installation is very easy. It takes 5-20 minutes to install depending on your server specs, and one command to run.

sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)

But I recommend you to also read CyberPanel Official tutorial for this.

How to Upgrade CyberPanel:

You can also update CyberPanel using only one command and as the installation, it also takes 5 minutes and a single command.

sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)

You can read the official guide for this also.

Install Redis and Redis PHP extension on CyberPanel

First of all, I am going with a short introduction to Redis. I know most of you know what Redis is and what are the uses of Redis. But some may be new to Redis so let me explain what it is.

Redis is an in-memory data structure store. Redis is used for caching, Session management, Subscriber base messages. Basically, Redis makes the process quicker. Let me be clear with an example of Twitter. Twitter is using Redis for subscribing, Liking, and all of that. You notice that when we have a new feed on twitter the whole page is not refreshed and you can see the message-like.

image 58

That is Redis. That did not allow the refresh of the whole page but adds the new content. Redis is an effective component to improve the speed of the site. If you want to know more about Redis goto there official site by clicking here.

Do you know? You can install Redis using CyberPanel in one click. CyberPanel developers added this new feature to install the Redis directly from the CyberPanel.

In the previous version of CyberPanel, if you wanted to install Redis and configure, you were required to install it using commands and then you have to install Redis extension from PHP extensions from CyberPanel. But this hustle is about to end in v2.0.3. Now CyberPanel makes it easy for its users.

I am going to explain what you have to do now in v2.0.3.

Install Redis:

To Install Redis first you must have a CyberPanel version v2.0.3. If you have this version then go to https://<your_ip>:8090/ and log in by providing credentials.

image 59

Once you login to your system now go to the ‘Manage Services->Applications‘. Let me make it more clear. Visit this link to install Redis https://<Your_IP>/manageservices/manageApplications.

image 60

Once you reach this page. No matter through the Option Stated above or using the link. You can see the option to install Redis Daemon.

Configure Redis Object Caching for WordPress on CyberPanel

Now to Click install button present in front of the Redis on your screen.

image 63

Now the real process starts. Once you click the window you can see a popup window appear which shows you the installation process and at the end of the process, you can see the version and all about the Redis information.

image 65

Once Installation is completed the page refreshes automatically and you can see that Redis is now installed, How cool is this?

For the removal of Redis, there is also one click in CyberPanel v2.0.3. You can see the status of Redis that it is installed and you can uninstall it by just clicking the remove button on the same page.

image 67

This one-click installation is an amazing feature in CyberPanel. Now you are done with the Redis installation its time to install the Redis PHP extension. For this follow the next step.

Install Redis Extension in CyberPanel:

Its time to install the Redis extension on CyberPanel. As you all know this one is not a new feature in CyberPanel. For the installation of Redis Extension go to the PPH->Install Extensions. You know we have an alternate path to access this point also and that is the link https://<Your_IP>/managephp/installExtensions

image 68

When you are on this page. Here you have to select a PHP version to install the extension for. Mostly the version that you are using for your site on which you want to setup Redis.

image 69

Select the required version and install the Redis extension for this version. For me, I selected PHP 7.4 for installation. Because I use this for my site. After selection, you search Redis in the search box and you get the required result. And you can see the install button.

image 71

Once you clicked the install button you can see the installation process.

image 72

After Installation go back and check the status of the extension.

image 74

All done from the CyberPanel. Now its time to setup on your WordPress site.

Install Redis Plugin on WordPress:

Now its time to install Redis on WordPress. The installation of every plugin is almost the same.

  1. Go to the admin dashboard in wp-admin
  2. Go to plugin
  3. Add new
  4. Search Redis in the bar and you can see the Redis plugin
  5. Click on install and then activate
image 56

Benchmark of WordPress site with and without Redis setup:

After activating this plugin now we are going to perform a benchmark for Redis which shows the difference after and before Redis results.

For both type of benchmark we select a constant value of data

h2load -n10000 -c100 -m10 https://ourdomain.com/

We are goin to use this command that mean we have three parameters here:

-n The number of total requests. we are going with 10000

-c The number of concurrent clients. we are going with 100

-m The max concurrent streams to issue per client. we are going with 10

Results Before enabling Redis:

According to the command motioned above we have the following results for our benchmark without enabling Redis.

image 58
[root@cento ~]# h2load -n10000 -c100 -m10 https://shoaibkhankhattak.tk/
starting benchmark…
spawning thread #0: 100 total client(s). 10000 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES128-GCM-SHA256
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done
finished in 208.14s, 48.04 req/s, 1.19MB/s
requests: 10000 total, 10000 started, 10000 done, 10000 succeeded, 0 failed, 0 errored, 0 timeout
status codes: 10000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 248.57MB (260644306) total, 145.97KB (149469) headers (space savings 95.87%), 247.74MB (259770000) data
min max mean sd +/- sd
time for request: 104.87ms 67.20s 14.39s 11.88s 90.34%
time for connect: 102.45ms 162.19ms 144.00ms 22.98ms 76.00%
time to 1st byte: 158.23ms 67.16s 24.80s 24.80s 76.00%
req/s : 0.48 1.75 0.96 0.57 60.00%
image 60
Mean time stats

Benchmark results After enabling Redis:

First of all you have to enable Redis for that Go to Admin Dashboard then Settings->Redis->Enable Object cache

image 59

Now we will look for the bencmark results:

image 61
starting benchmark…
spawning thread #0: 100 total client(s). 10000 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES128-GCM-SHA256
Server Temp Key: ECDH P-256 256 bits
Application protocol: h2
progress: 10% done
progress: 20% done
progress: 30% done
progress: 40% done
progress: 50% done
progress: 60% done
progress: 70% done
progress: 80% done
progress: 90% done
progress: 100% done
finished in 180.50s, 55.40 req/s, 1.38MB/s
requests: 10000 total, 10000 started, 10000 done, 9991 succeeded, 9 failed, 0 errored, 0 timeout
status codes: 9991 2xx, 0 3xx, 0 4xx, 9 5xx
traffic: 249.24MB (261343519) total, 149.02KB (152593) headers (space savings 95.78%), 248.40MB (260466602) data
min max mean sd +/- sd
time for request: 20.74ms 180.35s 11.68s 11.02s 91.20%
time for connect: 90.91ms 251.48ms 148.32ms 36.94ms 73.00%
time to 1st byte: 172.45ms 54.38s 13.31s 15.11s 81.00%
req/s : 0.55 1.25 0.95 0.29 56.00%
image 62

Wonderful And Creative Uses of PHP

PHP is one of the most popular programming languages that is used for web development. Mostly used for dynamic programming and server development. PHP was originally created by Danish-Canadian Canadian programmer Rasmus Lerdorf in 1994. There are many wonderful and creative uses of PHP for its users.

Php Stand for Hypertext Preprocessor. In this article, we will discuss some wonderfully uses of PHP That make your site more useful.

Table Of Contents:

  1. WordPress Theme Development
  2. Image Processing And Generations
  3. Content Management Systems
  4. Server-Side Backend Code
  5. Write Your Own Script Code
  6. WordPress plugin development
  7. Integrate AMP
  8. E-commerce Development
  9. Cyber Security and Authentication
  10. Real Time Applications

WordPress Theme Development

Uses of PHP

WordPress is a free and open-source CMS written in PHP. WordPress is one of the most used CMS. Over 1.3 billion websites are using WordPress. This popular CMS use themes and plugins to manage the users’ data.

With the popularity of WordPress Demand for WordPress themes also increased. There are a large number of WordPress themes on different platform of WordPress like Theme Forest.

PHP plays an important role in the development of the WordPress theme. All files with .php extension in WordPress theme code are PHP code files.

WordPress theme development do not need any expert level PHP understanding you can start with a basic knowledge.

Server-Side Backend Code

Server-Side Backend Code

Web development is often divided into two parts like front-end and back-end. Front end is basically the users interface. What a user can see.

Basically front end is practice to convert the data in visuals. Using different programming languages and techniques. Like HTML, CSS, JavaScript, React, Angular etc.

Backed is the part which is not accessible for the user, typically responsible for storing and manipulating data. But it enable a website to function properly.

There are many tools, techniques and languages that are use to develop server side back-end.

PHP is one of the most popular among them. PHP is used to develop and build server-side back-end systems. PHP performs very well in back-end techniques and processing.

Content Management Systems

Content Management Systems

A content management system is a system that is used to manage digital content, allowing multiple contributors to create, edit and publish.

PHP is the most popular platform to create CMS. There are many CMS built using PHP. Like WordPress, Drupal, etc. There are many online resources with them you can start building CMS from scratch.

WordPress plugin development

WordPress plugin development

If you are working with WordPress you must know about the WordPress Plugins. There are large number of WordPress plugins present in WordPress plugin repository and on plugins site. These plugins are free and pro versions.

Like theme development if you have basic knowledge of PHP you can develop plugins.

There are verity of WordPress plugins like plugins for Woocomerace, Page builders, Cache Plugins, etc.

Image Processing And Generations

Image Processing And Generations

There is a library called GD. Using this library with PHP, you can output images in different file types like jpeg, png and gif. This feature is very useful. You can create thumbnails, crop pictures, resize pictures, and if you want to create a photo gallery you can do it.

You can create different formats of images with just few lines of code.This thing is very useful and helpful for front-end.

Write Your Own Script Code

Write Your Own Script Code

PHP scripts are usually use for back-end. But you can use script for other cases too like make a script for email list. you can send a notification by using PHP script. These are some wonderful uses of PHP scripts.

You can also run PHP scripts using command line interface (CLI).

Integrate AMP

Integrate AMP

Accelerated Mobile Pages (AMP) is basically use to optimized for mobile web browsing and intended to load web pages faster. AMP reduce website load time on mobile.

In this Amazing technique PHP helps to improve the loading speed. And this load speed helps site to improve ranking. It also effects the SEO.

E-commerce Development

E-commerce Development

One of the most important role of PHP is its use in e-commerce. Design and develop a e-commerce website from scratch is very tough and time-taking process. Even integration of an existing e-commerce system with new system is also a tough process.

But if you are an expert of PHP you can easily find a solution for this problem, Creating from scratch or integrating existing one.

There are many existing PHP Frameworks for e-commerce. By using that you can easily done your work. There is no need to write code from scratch instead use a PHP framework.

PHP frameworks such as Cake PHP, Symphony, Laravel, Code-igniter are of great help to developers.

Cyber Security and Authentication

Cyber Security and Authentication

Now the most important thing for any site is its security. According to a survey On average 30,000 new websites are hacked every day. An other report say that “Above 60% companies faced web-based attacks”.

Hacker are always try to find some way to hack any site and get data access. PHP is very useful for this. it is a great language that helps you to combine cyber security on your website.

The setup of Cyber security mechanism with PHP development tools helps to prevent ongoing frequent cyber attacks.

User authentication is one of the most important aspect of web security. Almost every site need to implement user authentication. there are a large number of techniques which are used for the implementation of user authentication.

Using PHP for this propose is very common and preferred way. PHP can easily store and retrieve username and password pairs on a database, using top-level encryption. You can also use different encryption techniques.

Real Time Applications

Real Time Applications

Now there are huge amount of real time applications. We can see the real time web application like chat, web games, monitoring systems, social media applications, networks, etc.

Developers develop real-time applications using different tools, techniques and technologies, Like React js, HTML, Node js, Angular, Express, CSS, and others.

PHP is also one of the most used platform in real time application. Some very popular real time application are developed in PHP.

Basically PHP is used to develop back end for real time applications. Now a days Node js is one of the popular technology for back-end but in some case it can not useful as PHP is.

Read More: HOW TO CHANGE TIMEZONE ON LINUX SERVER

Follow US on Facebook / Twitter  for update.

How to optimize WordPress site using LSCache Plugin

Learn from Niel Patel as to why slow speed is a killer for your online business and let see how you can easily speed up your website.

WordPress is a free Content Management System (CMS) used by more than 60 million websites, WordPress is one of the most popular CMS solutions. Considering the popularity of this CMS, optimizing WordPress sites to load quickly is very important and sometimes it is difficult. PageSpeed of any website is one of the major factors for both usability and SEO. In this article, we will discuss how you can improve the loading speed of your WordPress site using LSCache Plugin.


Table of Contents

  1. What is PageSpeed or Page Optimization?
  2. Factors that affect the PageSpeed of a WordPress site.
  3. How to improve PageSpeed.
  4. How to check PageSpeed.
  5. Benefits of PageSpeed.

1. What is PageSpeed or Page Optimization?

Basically PageSpeed means that how quickly a web page load when a visitor clicks on the link or types in the URL. Usually, a visitor expects that their pages load quickly and this imparts a good first impression on them. PageSpeed not only creates a good impression but also improve search ranking as it affects the SEO


2. Factors that affect the PageSpeed of a WordPress site:

  1. Un-optimized media (Large-sized images and videos)
  2. Un-used CSS and JS
  3. Un-Minified CSS and JS
  4. Excessive Use of Plugins and Widgets (In-active and unnecessary plugins)
  5. WordPress Theme (Theme Choice is important)
  6. Poor Choice of Hosting Service.

3. How to improve PageSpeed:

Follow the steps mentioned below to improve overall speed of your WordPress site.

3.1 Optimize or Reduce media size:

Use of Images and videos make the content more beautiful and attractive but a common mistake is to upload pictures and video directly without any optimization. Always optimize media like videos and images before uploading it on site for use. Use the latest jpg/jpeg version only, PNGs should only be used when transparency is needed. Lower images result in smaller page sizes hence a boost to Pagespeed.

For the images that have been uploaded already, you can also use WordPress plugins for image optimization.

Most Common Image Optimization Plugins:

  1. LiteSpeed Cache
  2. Imagify
  3. Optimole
  4. ShortPixel Image Optimizer

There are many image optimization plugins on WordPress plugins directory, let see how we can use LiteSpeed Cache plugin to optimize images:

  1. Click on LiteSpeed Cache -> Image Optimization. 
  2. Click on Send for Optimization button until all the images are optimized
  3. Once optimization is completed click on Gather image Data.
  4. Check the Image information section on the right side, it shows the optimization status. Green ticks suggest complete optimization.
Image Optimization
  1. Go on the Image Optimization Settings Option on screen.
  2. Check all the options as shown in the picture.
Image Optimization

3.2 Minify HTML, CSS and JS Files:

Minification of HTML, CSS, and JS files are some of the most common and important steps to increase page speed.  Google PageSpeed Insights and/or any other page speed tool always recommends this.

This issue happens due to the white spaces and extra CSS and JS  on the website page.

You can fix these issues manually or use a WordPress plugin to do so. Some plugins are listed below.

  1. LiteSpeed Cache
  2. Autoptimize
  3. JCH Optimize

Minify CSS and JS using LiteSpeed Cache:

  1. Click on LiteSpeed Cache -> Page Optimization -> JS Settings
  2. Change your settings according to the image below
  3. Follow this guide in case this setting breaks any functionality or visual structure of your site
Js Optimization
  1. Click on LiteSpeed Cache -> Page Optimization -> CSS Settings
  2. Change your settings according to the image below
  3. Follow this guide in case this setting breaks any functionality or visual structure of your site
CSS Setings

3.3 Excessive Use of Plugins and Widgets:

Excessive use of Plugins and Widgets can also slow down your PageSpeed. Always take care of extra and unnecessary Plugins and Widgets. Uninstall all in-active and unused plugins from sites. Never add any unused widgets.

Delete extra/inactive Plugins

  1. Click on Plugins->Installed plugins -> InActive
  2. Click on the Delete option right below the plugin name
Uninstall Plugin

3.4 Theme Choice:

The choice of theme to run the site is very important. Always choose a lite-weight theme for your site. Unlicensed/nulled themes slow down PageSpeed of your site so always use a licensed theme for the site.


3.5 Choice of Hosting service:

Hosting service is one of the main reasons behind the low PageSpeed. To run a  site on a shared server may be good from a financial point of view but it usually fails to deliver good loading times on peak traffic hours. So always use a good web hosting provider for your site to achieve a better PageSpeed, SEO, and traffic.


4. How to Check PageSpeed:

There are many ways to check the page speed of any site. A lot of sites are there to check the Page Speed of any site. Google also offers a tool called Google PageSpeed Insights for this.

Some sites that can help you to check various factors affecting your PageSpeed:

How to optimize WordPress site using LSCache Plugin

5. Benefits of high PageSpeed:

  1. PageSpeed improves search engine rankings
  2. It is important for SEO
  3. It ensures a good first impression on the visitor
  4. Also, help to decrease the Bounce Rate so visitors love to navigate between pages

Read More: HOW TO CHANGE TIMEZONE ON LINUX SERVER

Follow US on Facebook / Twitter  for updates.