Issue configuration Redis

Xadeon

New member
Joined
Jan 10, 2025
Messages
2
Hello,

I have tried to get Redis working alongside OpenLiteSpeed, but despite my research and efforts, I have not been able to find a solution to my problem.

First, to clarify right away:
• I have full access, it’s my server
• Port 6379 is open
• I am using /home/admin/.redis/redis.sock for the connection (although localhost works… when it works)
• I am using WooCommerce with the LiteSpeed plugin
• Redis is enabled in the DirectAdmin panel for the user
• I installed OpenLiteSpeed, Redis, and php-redis via CustomBuild
• I have done extensive research and various tests without finding a solution, whether in the docs, on Google, assisted by ChatGPT, or on this forum.

Basically, the problem is that I am forced to run the “redis-server” command to establish a connection to Redis, even though the “[email protected]” service is running and listening for a connection. I also tried setting it to start automatically on boot, but without success — after a reboot, it no longer works.

I can only get the connection to work with this method. I’ve tried reinstalling Redis several times.

Do you have any suggestions? A deep cleanup and a step-by-step reinstallation?

I don’t think I’ve missed anything, but I feel like the configuration with DirectAdmin isn’t always as straightforward as it should be.

Thanks in advance.
 
Nothing looks wrong with this at first glance. What Linux distribution?

It's weird that localhost connects. Do you see an entry for /home/admin/.redis/redis.sock in `ss -np | grep redis`?
 
Thank you for your answer

No but I have this :
u_str ESTAB 0 0 /var/lib/rspamd/.redis/redis.sock 218017 * 221729 users:(("redis-server",pid=809,fd=7))
u_str ESTAB 0 0 * 171072 * 168714 users:(("redis-server",pid=4230,fd=2),("redis-server",pid=4230,fd=1))
u_str ESTAB 0 0 /var/lib/rspamd/.redis/redis.sock 218024 * 219903 users:(("redis-server",pid=809,fd=11))
u_str ESTAB 0 0 /var/lib/rspamd/.redis/redis.sock 218018 * 220911 users:(("redis-server",pid=809,fd=8))
u_str ESTAB 0 0 /var/lib/rspamd/.redis/redis.sock 218022 * 219902 users:(("redis-server",pid=809,fd=10))
u_str ESTAB 0 0 /var/lib/rspamd/.redis/redis.sock 218020 * 219901 users:(("redis-server",pid=809,fd=9))
u_str ESTAB 0 0 * 23638 * 25623 users:(("redis-server",pid=809,fd=2),("redis-server",pid=809,fd=1))

For information, when I ask the service
[email protected] - Multi-user redis persistent key-value database
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; preset: disabled)
Active: active (running) since Fri 2025-01-10 22:32:57 CET; 1h 19min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 4228 ExecStartPre=/bin/mkdir -p ${HOME}/.redis/db/ (code=exited, status=0/SUCCESS)
Process: 4236 ExecStartPost=/bin/sh -c if [ -d /sys/fs/cgroup/user.slice ]; then mkdir -p /sys/fs/cgroup/user.slice/user-$(id -u ${USER}).slice/directadmin-exec.scope; echo $MAINPID >>
Main PID: 4230 (redis-server)
Status: "Ready to accept connections"
Tasks: 0 (limit: 101895)
Memory: 5.0M
CPU: 51ms
CGroup: /system.slice/system-redis.slice/[email protected]
‣ 4230 "/usr/local/bin/redis-server unixsocket:/home/admin/.redis/redis.sock"

Jan 10 22:32:57 vps redis-server[4230]: 4230:M 10 Jan 2025 22:32:57.095 * monotonic clock: POSIX clock_gettime
Jan 10 22:32:57 vps redis-server[4230]: 4230:M 10 Jan 2025 22:32:57.095 * Running mode=standalone, port=0.
Jan 10 22:32:57 vps redis-server[4230]: 4230:M 10 Jan 2025 22:32:57.096 * Server initialized
Jan 10 22:32:57 vps redis-server[4230]: 4230:M 10 Jan 2025 22:32:57.096 * Loading RDB produced by version 7.2.4
Jan 10 22:32:57 vps redis-server[4230]: 4230:M 10 Jan 2025 22:32:57.096 * RDB age 0 seconds
Jan 10 22:32:57 vps redis-server[4230]: 4230:M 10 Jan 2025 22:32:57.096 * RDB memory usage when created 0.83 Mb
Jan 10 22:32:57 vps redis-server[4230]: 4230:M 10 Jan 2025 22:32:57.096 * Done loading RDB, keys loaded: 1, keys expired: 0.
Jan 10 22:32:57 vps redis-server[4230]: 4230:M 10 Jan 2025 22:32:57.096 * DB loaded from disk: 0.000 seconds
Jan 10 22:32:57 vps redis-server[4230]: 4230:M 10 Jan 2025 22:32:57.096 * Ready to accept connections unix
Jan 10 22:32:57 vps systemd[1]: Started Multi-user redis persistent key-value database.

But if ping Redis :
Could not connect to Redis at 127.0.0.1:6379: Connection refused

I also have a 503 error if I try to access the Openlitespeed admin panel, I don't know if that can play a role. I had in the testing phase, tested the openlitespeed/redis configuration with CyberPanel before taking a Directadmin license. I had excellent results in a few clicks. Here I lost efficiency but maybe it's because Redis is not functional, so I'm still leaning towards a configuration problem somewhere.
 
But if ping Redis :
Ping should never work for the DirectAdmin managed Redis, as it will bind it to the unix socket only. The correct solution is to use the redis-cli.

Code:
/usr/local/bin/redis-cli -s /home/admin/.redis/redis.sock ping

Try restarting the [email protected]. If that fails, seems like a bug possibly.
 
Back
Top