Publishes a new blog post about Redis installation

This commit is contained in:
Samuel FORESTIER 2019-01-25 00:16:50 +01:00
parent ab7693e2f3
commit e0d88a29b4
2 changed files with 92 additions and 0 deletions

@ -0,0 +1,89 @@
---
title: "Some Redis installation notes"
date: 2019-01-25
url: some-redis-installation-notes
layout: post
category: Tutorials
image: /img/blog/some-redis-installation-notes.png
description: "A blog post with a full and viable Redis installation procedure on Debian"
---
[![A missing blog post image](/img/blog/some-redis-installation-notes.png)](/img/blog/some-redis-installation-notes.png)
### Introduction
I've just achieved one more Redis installation today, and as the previous ones, I had to browse the WEB again, looking for the same pieces of information.
You'll find below my Redis-installation-memo (at least for me, in the future).
No slow listening TCP sockets. Only a hardened UNIX one.
No boot warnings. Only Linux kernel tweaks.
No hand-made BASH scripts for standalone program administration. Only a systemd-supervised instance.
> A Debian-sponsored procedure.
### The procedure
{% highlight bash %}
aptitude install -y redis-server
systemctl stop redis-server.service
nano /etc/redis/redis.conf
: '
# ...
port 0
# ...
tcp-backlog 128
# ...
unixsocket /var/run/redis/redis.sock
unixsocketperm 770
# ...
supervised systemd
# ...
requirepass <at-least-a-64-byte-long-random-string>
'
sysctl -w vm.overcommit_memory=1
echo -e '\n\n# REDIS\nvm.overcommit_memory = 1' >> /etc/sysctl.d/99-sysctl.conf
systemctl edit --full redis-server.service
: '
# ...
[Service]
Type=notify
# ...
ExecStartPre=/bin/echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
# ...
'
systemctl daemon-reload
systemctl start redis-server.service
{% endhighlight %}
At this time the server should be up and running, you may want to check that everything went fine this way :
{% highlight bash %}
tail /var/log/redis/redis-server.log
{% endhighlight %}
---
For Redis usage from PHP-based applications you'll need :
{% highlight bash %}
usermod -a -G redis www-data
# Using `mod_php` ?
systemctl restart apache2
# Using FPM ?
systemctl restart php7.X-fpm
{% endhighlight %}
---
### Conclusion
No conclusion. It should work, even for you, young WEB-wanderer.

BIN
img/blog/some-redis-installation-notes.png (Stored with Git LFS) Normal file

Binary file not shown.