Throughout this tutorial, you'll learn how to install Redis and the PHP Redis to drastically improve your server's performances
Redis is an open source solution which acts as a database of structured cached data which is stored in a the RAM of your server. Instead of relying on the disk latency, the cache, being in the memory, will provide a way faster throughput.
The guide presupposed that you have a CentOS 7 server with cPanel installed. If you have a Managed Server the installation can be done by our support.
1) Login through SSH and run the following commands :
sudo yum install epel-release yum-utils sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm sudo yum-config-manager --enable rem yum install redis
2) Once installed, you would need to start it:
sudo systemctl start redis sudo systemctl enable redis sudo systemctl status redis
The latest command should give you a confirmation of that Redis is running.
redis.service - Redis persistent key-value database Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/redis.service.d └─limit.conf Active: active (running) since Sat 2020-06-24 15:21:55 GMT +1; 40s ago Main PID: 2157 (redis-server) CGroup: /system.slice/redis.service └─2157 /usr/bin/redis-server 127.0.0.1:6379
It also returns the port being used (here 6379) which you may need for your application.
3) Login to WHM and search in the WHM sidebar for Module Installers. Click on it and then click on Manage PHP PECL.
4) At the next stage, select the PHP version you would like to install Redis For and inside the Module Search type Redis and click on Go
5) Finally, in the search result click on Install and after a few seconds, it should be completed.
That's it, you have now enabled a Redis Cache on your server.