We will start and check the status of the Redis with the below commands: $ systemctl start rvice Save and close the file, then restart the Redis service: systemctl restart rvice To configure the max memory for Redis as well as how Redis will select what to remove when the max memory is reached, add the following lines at the end of the file: maxmemory 128mb To configure Redis as a cache you need to edit the /etc/redis/nf file: nano /etc/redis/nf Following command will install and setup redis extension with php: apt-get install php-redis Here we will cover installation of Redis Extension of php from source compilation and using apt repository. Redis provide php extension to work with php. Run the command below to install Redis on your machine: apt-get install redis-server First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal. I will show you through the step by step installation Redis on a Ubuntu 16.04 LTS (Xenial Xerus) server. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges.
This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. It would be smart to bring ‘Redis’ into practice and put ‘Memcache’ down for a while. ‘Redis ’ is considered more powerful than ‘Memcache’. Redis also supports datatypes such as Transitions, Publish and Subscribe. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. Now, add the private IP address that you want to allow to pass through the firewall.Redis is an open source, BSD licensed, advanced key-value store. sudo firewall-cmd -permanent -zone=redis -add-port=6379/tcp Enter r edis-cli pingĬonfiguring the firewall to allow traffic from port 6979 sudo firewall-cmd -permanent -new-zone=redisĪfter adding the new zone, add port 6379.
To confirm the install of Redis has been successful, can perform a test to this will use the Redis command line. Within the same configuration file, find the line supervised no and switch it to supervised systemd. If you want to have a remote connection to the redis server, we need to change the protection to connect by locating the current line protection-mode no and change this to yes. If you do choose to have Redis running on a public IP then ensure that the Redis port is firewalled as detailed below. If this is something you are not doing, leave this section out and go to testing. This will allow redis to communicate with remote devices. Once in the file will need to locate the following lines and make some changes. The next step is to install the Redis application on Almalinux dnf install redis -yĪfter the install has been complete, you will need to change some settings in the configuration file, open the file and edit with by entering the following command: vi/etc/nf
Updating the System sudo dnf update & upgrade However, this can be done on a vast range of different platforms.įirst of all, we need to ensure that the system is up to date with the latest application this is done by running the following command. This article shows you how to install and configure Redis on the AlmaLinux operating system. Redis supports data structures, such as Lists, Strings, and Sets, widely recognised due to its broad support, performance, availability, and flexibility. Redis is a popular and open-source in-memory key-value or data structure store used as a distributed database, message broker, and cache.