Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
litespeed_wiki:cache:redis [2017/08/30 15:51] Eric Leu [Install Redis PHP extension] |
litespeed_wiki:cache:redis [2020/03/03 14:22] Jackson Zhang [Install Redis PHP extension] |
||
---|---|---|---|
Line 3: | Line 3: | ||
==== Install Redis daemon ==== | ==== Install Redis daemon ==== | ||
- | For cPanel/Plesk and Native LSWS setup on CentOS 7: | + | For cPanel/Plesk/DirectAdmin and Native LSWS setup on CentOS 7: |
- Add the EPEL repository: \\ <code>yum install epel-release </code> | - Add the EPEL repository: \\ <code>yum install epel-release </code> | ||
- Install Redis: \\ <code>yum install redis</code> | - Install Redis: \\ <code>yum install redis</code> | ||
Line 44: | Line 44: | ||
General Plesk support php-redis extention\\ | General Plesk support php-redis extention\\ | ||
{{:litespeed_wiki:cache:redis-7.png?600|}}\\ | {{:litespeed_wiki:cache:redis-7.png?600|}}\\ | ||
- | If your Plesk version not support php-redis by default, please try compile [[https://serverpilot.io/community/articles/how-to-install-the-php-redis-extension.html | Here]] | + | If your Plesk version not support php-redis by default, please try compile [[https://talk.plesk.com/threads/redis-activation-installation-problems-plesk-onyx.342245/ | Follow Here]] |
+ | === With DirectAdmin === | ||
+ | DirecAdmin custombuild 2 will install phpxx to /usr/local/phpxx, you can go to the version you want (such as php73) to build php-redis through pecl: | ||
+ | | ||
+ | cd /usr/local/php73/bin | ||
+ | ./pecl install igbinary igbinary-devel | ||
+ | ./pecl install redis | ||
+ | | ||
+ | Check the path of extensions. | ||
+ | ll /usr/local/php73/lib/php/extensions/ | ||
+ | drwxr-xr-x 2 root root 76 Mar 3 14:05 no-debug-non-zts-20180731 | ||
+ | | ||
+ | Then add both igbinary.so and redis.so to a newly created 10-directadmin.ini | ||
+ | vi /usr/local/php73/lib/php.conf.d/10-directadmin.ini | ||
+ | | ||
+ | extension=/usr/local/php73/lib/php/extensions/no-debug-non-zts-20180731/redis.so | ||
+ | extension=/usr/local/php73/lib/php/extensions/no-debug-non-zts-20180731/igbinary.so | ||
+ | |||
+ | Restart lsphp to make the change effective: | ||
+ | killall -9 lsphp | ||
+ | | ||
=== Without control panel === | === Without control panel === | ||
- Add the litespeed repository: \\ <code>rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm</code> | - Add the litespeed repository: \\ <code>rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm</code> | ||
Line 82: | Line 102: | ||
**Note:** For more redis benchmark information, please refer to [[https://redis.io/topics/benchmarks | this]] | **Note:** For more redis benchmark information, please refer to [[https://redis.io/topics/benchmarks | this]] | ||
==== Integrate WordPress with Redis ==== | ==== Integrate WordPress with Redis ==== | ||
- | - Install the **Redis Object Cache** WordPress Plugin \\ {{:litespeed_wiki:cache:redis-5.png?400|}} | + | Please refer the following article |
- | - Activate the plugin and click **Enable Object Cache** button \\ {{:litespeed_wiki:cache:redis-2.png?600|}} | + | [[litespeed_wiki:cache:lscwp:configuration:cache:object_cache|Memcached, LSMCD and Redis (Object Cache) Support in LSCWP]] |
- | - Confirm Status is ''Connected'' \\ {{:litespeed_wiki:cache:redis-3.png?600|}} | + | |
- | - Confirm Diagnostics shows Redis with version \\ {{:litespeed_wiki:cache:redis-6.png?600|}} | + | |
- | - Edit ''wp-config.php'' and at the end of the ''Authentication Unique Keys and Salts'' section, add the following lines: | + | |
- | * ''<nowiki>define('WP_CACHE_KEY_SALT', 'string');</nowiki>'' | + | |
- | * ''<nowiki>define('WP_CACHE', true);</nowiki>'' | + | |
- | - Restart LSWS \\ <code>service lsws restart</code> | + | |
- | - Test that WordPress is communicating with Redis via a ''monitor'' command: \\ <code> redis-cli monitor </code> {{:litespeed_wiki:cache:redis-4.png?300|}} | + | |