Let us take close look at how to manage the DigitalOcean Debian install Redis with the support of our Server Management Support services at Bobcares.
How to Install Redis 4.x from Source on Linux?
Redis is an in memory key value store that is known for its ability to adapt, speed, and large scale language support. So let us take a look at how to install, and secure Redis on a Debian 10 server.
When we use an up to date provider, such as DigitalOcean or AWS, and a current Linux version, such as Ubuntu 17.10, we can install the newest version of Redis. This will only take a few simple steps.
# Ubuntu / Debian: sudo apt-get install redis-server -y# RHEL-ish systems: sudo yum install redis -y
or if we want to carry out through Docker then follow the command given below:
docker run -d -p 6379:6379 redis:latest
However, if we’re using an earlier version of Linux, or even a distant LTS version, which isn’t such a bad idea for a production server, we may have issues.
Finding a cheap Redis server might be difficult. Redis uses a large amount of memory. Memory is quite costly, and providers such as DigitalOcean and Amazon Web Services charge a premium for high memory instances.
Install Build Dependencies; for DigitalOcean Debian Install Redis
We’ll be creating it Redis from the source, thus we’ll need the following packages:
# Ubuntu / Debian:
sudo apt-get install build-essential tcl wget# RHEL-ish systems:
sudo yum groupinstall 'Development Tools'
sudo yum install tcl wget
Download the Latest Redis 4.x Source for DigitalOcean Debian Install
Locking down a certain version of any software dependency we employ is a smart approach.
# For version 4.0.8 (good on production):
wget -c http://download.redis.io/releases/redis-4.0.8.tar.gz# For the latest stable version:
wget -c http://download.redis.io/releases/redis-stable.tar.gz
Assume we have version 4.0.8 from the link above. If we download the redis stable, the folder will be named that in the next instructions, therefore we’ll need to modify them.
tar -xvf redis-4.0.8.tar.gz
Build from Source
As we just took out the Redis code into its own folder, we must cd in and build as the next step in DigitalOcean Debian install redist:
cd redis-4.0.8
make
sudo make install
cd utils/
./install_server.sh
Depending on how quickly the server is, this may take some time. The last command will prompt us to a few choices, which we normally leave alone.
It will start a new system service named Redis 6379 and print the location of the default Redis setup file.
On Ubuntu/Debian this is /etc/redis/6379.conf
.
We’re ready to go when we’re ready to turn on Redis:
sudo service redis_6379 start
# or
sudo systemctl start redis_6379
Service Gotcha — Names
The previous install will produce a new service called Redis 6379, not Redis or Redis-server. So remember to call this anytime we execute service or systemctl instructions. To complete the digitalocean Debian install Redis process.
Secure the Redis Server
For production systems, it is better to use the settings described below:
To have it start automatically with Linux, enter the following command lines:
sudo systemctl enable redis_6379# To block all remote traffic to Redis except for local and one IP address (e.g. your web server)
iptables -A INPUT -p tcp --dport 6379 -s 127.0.0.1 -j ACCEPT
iptables -A INPUT -p tcp --dport 6379 -s X.X.X.X -j ACCEPT
iptables -A INPUT -p tcp --dport 6379 -j DROP
[Need assistance with similar queries? We are here to help]
Conclusion
To conclude we have now learned about the DigitalOcean Debian install Redis and the configuration steps necessary to complete the installation process successfully with the assistance of our Server Management Support Services at Bobcares.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
0 Comments