Redis is open source, fast in-memory data structure store. used for database, cache or message-broker. Redis is widely used for chat messaging application for its speed and flexibility.
In this article we will install and configure Redis server in Ubuntu 20.04 version.
First update your package repository list using apt update command.
sudo apt update
Then install Redis server with below command.
sudo apt install redis-server
Now you have installed Redis server in your system. Now we will need to configure and secure Redis server.
Open the redis config file in nano editor using below command
sudo nano /etc/redis/redis.conf
Find the below line in the General section.
Change it to systemd. This will enable redis to interact with your system supervision tree.
Now search for the below line.
If there is no bind directive is defined, Redis will listen from connections from all the network interfaces available on the server. So we need to remove comment. This will bind Redis server to listen from localhost only.
Now save and exit the file. You will also need to restart the Redis server.
sudo systemctl restart redis.service
If you want to check the Redis status, you can check with below command.
sudo systemctl status redis
If your web application is built in PHP language, then you need to install php-redis extension to interact with Redis.
sudo apt install php-redis
For further details, visit Redis documentation site.
Was this article helpful?
Leave a comment
Copyright 2021 HackTheStuff