close

Checkpoint Endpoint Security Firewall Policy

Back to .

Navigate to MY RESOURCES -> Manage. On the Manage page, you need to record the value of the Resource Name, Endpoint, and Redis Password. (Click Show to see the value of the Redis password.)

View the Redis Cloud service access information

Install the Redis Object Cache plug-in in WordPress

There is a plug-in named in the WordPress plug-in community. This plug-in uses the Redis PHP Extension Community Library (PECL) module to connect to Redis, so we need to install the Redis PECL module first:

  • Install the EPEL Repo by using the following commands:
  • # wget # wget # sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
    Enable the PHP Extension Community Library by using the following commands: # sudo yum -y install gcc # sudo yum -y install php-pear Install the Redis PECL module by using the following command: # sudo pecl install redis To load the extension on the PHP startup, use the following command: # sudo echo "extension=redis.so" >> /etc/php.ini
To auto install the Redis Object Cache plug-in from the WordPress admin panel, follow these steps: Navigate to Plugins -> Add New. Search for Redis Object Cache. Find the Redis Object Cache plug-in. Click Install Now (under the plug-in name) to install the plug-in. Install Redis Object Cache plug-in Or, to upload the Redis Object Cache plug-in manually, follow these steps: Download the . Upload the Redis Object Cache plug-in (redis-object-cache.1.0.zip) to the $YOURWP/wp-contents/plugins/ folder. Extract the plug-in package: # sudo unzip redis-object-cache.1.0.zip Configure the Redis Object Cache plug-in in WordPress By default, the plug-in uses 127.0.0.1 and 6379 as the default host and port when you create a new client instance. The default database of “0” is also used. So, we need to point the plug-in to our newly subscribed Redis Cloud resource. To redirect the plug-in, follow these steps: Move the object-cache.php file to the wp-content/ directory. The plug-in’s major functionis in the object-cache.php file. To make this plug-in take effect, we need to move it from wp-content/plugins/redis-object-cache to wp-content/ by using the following command: # mv $YOURWP/wp-content/plugins/redis-object-cache/object-cache.php $YOURWP/wp-content/ Edit the object-cache.php file. In the object-cache.php file, three constants, WP_REDIS_BACKEND_HOST, WP_REDIS_BACKEND_PORT, and WP_REDIS_BACKEND_DB, are supported to specify the non-default Redis connection. We need to edit object-cache.php to add the following four lines at the beginning of the file (around line 23). The file needs to look like this example: /** * Adds a value to cache. * * If the specified key already exists, the value is not stored and the function * returns false. * * @param string $key The key under which to store the value. * @param mixed $value The value to store. * @param string $group The group value appended to the $key. * @param int $expiration Theexpiration time, defaults to 0. * * @global WP_Object_Cache $wp_object_cache * * @return bool Returns TRUE on success or FALSE on failure. */ define("WP_REDIS_BACKEND_HOST", "pub-redis-11223.dal-05.1.sl.garantiadata.com"); define("WP_REDIS_BACKEND_PORT", "11223"); define("WP_REDIS_BACKEND_DB", "wordpress"); define("WP_REDIS_PASSWORD", "passw0rd"); Use the Redis Cloud access information that you recorded in the “Get a Redis Cloud service account” section to set the value of the above constants. Use the “Resource Name” value for WP_REDIS_BACKEND_DB. Split the “Endpoint” value into the host and port for WP_REDIS_BACKEND_HOST and WP_REDIS_BACKEND_PORT. And, use the “Redis Password” value for WP_REDIS_PASSWORD. Because the original Redis Object Cache plug-in does not support connecting to Redis with a password, we need to slightly modify the plug-in’s code to adopt the Redis Cloud, which uses a password to protect the data set. That is why we added an extraconstant, WP_REDIS_PASSWORD, above. Additionally, we also need to modify the connecting code to consume the WP_REDIS_PASSWORD: Add the following code around line 325: if ( defined( 'WP_REDIS_PASSWORD' ) && WP_REDIS_PASSWORD ) { $redis['password'] = WP_REDIS_PASSWORD; } Add the following code around line 330: $this->redis->auth( $redis['password'] ); The file needs to look like this example: public function __construct() { global $blog_id, $table_prefix; // General Redis settings $redis = array( 'host' => '127.0.0.1', 'port' => 6379, ); if ( defined( 'WP_REDIS_BACKEND_HOST' ) && WP_REDIS_BACKEND_HOST ) { $redis['host'] = WP_REDIS_BACKEND_HOST; } if ( defined( 'WP_REDIS_BACKEND_PORT' ) && WP_REDIS_BACKEND_PORT ) { $redis['port'] = WP_REDIS_BACKEND_PORT; } if ( defined( 'WP_REDIS_BACKEND_DB' ) && WP_REDIS_BACKEND_DB ) { $redis['database'] = WP_REDIS_BACKEND_DB; } if ( defined( 'WP_REDIS_PASSWORD' ) && WP_REDIS_PASSWORD) { $redis['password'] = WP_REDIS_PASSWORD; } // Use Redis PECL library if available, otherwise default to bundled Predis library if ( class_exists( 'Redis' ) ) { try { $this->redis = new Redis(); $this->redis->connect( $redis['host'], $redis['port'] ); $this->redis->auth( $redis['password'] ); if ( isset( $redis['database'] ) ) { $this->redis->select( $redis['database'] ); } Verification Open a web browser and log on to . Navigate to MY RESOURCES -> Dashboard. On the Dashboard page, you can see the dynamic throughput and latency of data read and write from your Redis Cloud. You can also see the used memory, total keys, and connections in your Redis Cloud. All of these parameters are zero if you have not accessed your WordPress blog since you installed and configured the plug-in. Now, use your browser to experiment with your WordPress. As shown in the following UI, you see the used memory, total keys, andconnections all increase in the dashboard. The throughput shows curves to indicate the read and write operations in the Redis Cloud, as well as the latency charts. Also, notice that if you access the pages for a second time, the page loads much faster than the first hit. Redis Cloud dashboard shows the traffic from wordpress Share this:

endpoint security download     endpoint security by bitdefender blocked this page

TAGS

CATEGORIES