Redis Archives - Vincent Verloop https://www.vincentverloop.nl/tag/redis/ IT Professional Thu, 21 Oct 2021 05:36:10 +0000 nl-NL hourly 1 88936650 PHP Redis Session Handler – WordPress Redis https://www.vincentverloop.nl/webhosting/php-redis-session-handler-wordpress-redis/ https://www.vincentverloop.nl/webhosting/php-redis-session-handler-wordpress-redis/#respond Fri, 27 Aug 2021 23:09:16 +0000 https://www.vincentverloop.nl/?p=2793 Redis is an open source key-value cache and storage system, also referred to as a data structure server for its advanced support for several data types, such as hashes, lists, sets, and bitmaps, amongst others. It also supports clustering, which makes it often used for highly-available and scalable environments. In this tutorial, we’ll see how […]

The post PHP Redis Session Handler – WordPress Redis appeared first on Vincent Verloop.

]]>
Redis is an open source key-value cache and storage system, also referred to as a data structure server for its advanced support for several data types, such as hashes, lists, sets, and bitmaps, amongst others. It also supports clustering, which makes it often used for highly-available and scalable environments.

In this tutorial, we’ll see how to install and configure an external Redis server to be used as a session handler for a PHP application running on CentOS 8.

The session handler is responsible for storing and retrieving data saved into sessions – by default, PHP uses files for that. An external session handler can be used for creating scalable PHP environments behind a load balancer, where all application nodes will connect to a central server to share session information.

How to Set Up a Redis Server as a Session Handler:

# nano /usr/local/php74/lib/php.ini
# session.save_handler = redis
# session.save_path = "tcp://127.0.0.1:6379?auth=secretpass123"

Redis Extra Security:

Set a Password for the Redis Server

To add an extra layer of security to your Redis installation, you are encouraged to set a password for accessing the server data. We will edit the same configuration file from the previous step, /etc/redis/redis.conf:

sudo nano /etc/redis/redis.conf

 Copy

Now, uncomment the line that contains requirepass, and set a strong password:/etc/redis/redis.conf

requirepass yourverycomplexpasswordhere

 Copy

Restart the Redis service so the changes take effect:

sudo service redis-server restart

The post PHP Redis Session Handler – WordPress Redis appeared first on Vincent Verloop.

]]>
https://www.vincentverloop.nl/webhosting/php-redis-session-handler-wordpress-redis/feed/ 0 2793