• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

How I Struggled (and Finally Succeeded) Configuring Redis on Oracle Linux

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Spoiler: It took me 1.5 days to do what could’ve been done in an hour—but that’s how you learn!

The Setup


I had two servers:

?️ A Linux server (Oracle Linux) where Redis was installed

? A Windows server running an application that needed to connect to Redis on port 6379

I thought: "Just install Redis, open port 6379, and boom—it works!"
But no, it wasn't that simple.

First Mistake: Trusting the Defaults
I installed Redis using dnf, which was easy enough. The real challenge started when I tried to connect from the Windows server. The connection kept failing—despite Redis running fine locally on the Linux machine.

I dove into the redis.conf file (the default config file created during installation), and here’s what I had to change:


bind 0.0.0.0
protected-mode no
These two lines are critical:

bind 0.0.0.0: Allows connections from any IP, not just localhost.

protected-mode no: Disables Redis’s "safe mode" that blocks external access.

After applying these changes and running redis-server redis.conf, I connected successfully from the Linux host using redis-cli. All seemed fine.

The Real Error: DENIED by Protected Mode


However, from the Windows server, I still couldn’t connect. A telnet to port 6379returned this error:


DENIED Redis is running in protected mode...

Even though I had disabled protected-mode, Redis still refused the connection.

The missing piece? Authentication.

Fixing It with Docker and a Custom redis.conf
To get more control and test things cleanly, I ran Redis using Docker and created a custom redis.conf:


bind 0.0.0.0
port 6379
daemonize yes
protected-mode no
requirepass MyStrongPassword

✅ That last line—requirepass—was the real key.

Once Redis had a password, everything worked. My application connected successfully from the Windows server.

So here’s a quick checklist for allowing remote connections to Redis:

✅ Edit redis.conf

bind 0.0.0.0

protected-mode no

requirepass your_secure_password

✅ Make sure port 6379is open in the firewall

✅ Restart Redis with the custom config

✅ Test with redis-cli -a your_password -h your_redis_host

What took me 1.5 days could’ve been an hour’s work—but hey, now I really understand Redis’s security model.

If you're setting up Redis for the first time and wondering why remote clients can't connect—check the config. Don't assume it’s the firewall or Docker networking. It's often just a missing requirepass.

Got Tips?


If you have more experience configuring Redis in production or have best practices to share, I’d love to hear from you. This was my first time doing it, and I’m sure there’s room to improve!


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу