• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Redis Unix Socket Connection Permission denied, TCP Connection working

Sally1

Regular Pleskian
Hello,

I have the Redis Object Cache Plugin installed on my website, connected via TCP to Redis Server is working fine. I try now to connect via Unix Socket, but get Connection Exception: Permission denied (RedisException).



Changed Redis to use Unix Socket

unixsocket /var/run/redis/redis.sock
unixsocketperm 770



redis.log

17960:M 14 Dec 2020 14:36:25.895 * Ready to accept connections
17960:M 14 Dec 2020 14:36:25.895 * The server is now ready to accept connections at /var/run/redis/redis.sock



ls -la /var/run/redis/

insgesamt 0

drwxr-xr-x 2 redis redis 60 15. Dez 09:49 .

drwxr-xr-x 34 root root 1060 15. Dez 09:49 ..

srwxrwx--- 1 redis redis 0 15. Dez 09:49 redis.sock


wp-config settings


define(‘WP_REDIS_SCHEME’, ‘unix’);
define(‘WP_REDIS_PATH’, ‘/var/run/redis/redis.sock’);



Server

CentOS Linux 7.9.2009 (Core)

Plesk Obsidian 18.0.32 Update1

PHP-FPM 7.4.13

MariaDB 10.5.8



Can someone help me?


Thank You!
 
Hello,

I have the Redis Object Cache Plugin installed on my website, connected via TCP to Redis Server is working fine. I try now to connect via Unix Socket, but get Connection Exception: Permission denied (RedisException).



Changed Redis to use Unix Socket

unixsocket /var/run/redis/redis.sock
unixsocketperm 770



redis.log

17960:M 14 Dec 2020 14:36:25.895 * Ready to accept connections
17960:M 14 Dec 2020 14:36:25.895 * The server is now ready to accept connections at /var/run/redis/redis.sock



ls -la /var/run/redis/

insgesamt 0

drwxr-xr-x 2 redis redis 60 15. Dez 09:49 .

drwxr-xr-x 34 root root 1060 15. Dez 09:49 ..

srwxrwx--- 1 redis redis 0 15. Dez 09:49 redis.sock


wp-config settings


define(‘WP_REDIS_SCHEME’, ‘unix’);
define(‘WP_REDIS_PATH’, ‘/var/run/redis/redis.sock’);



Server

CentOS Linux 7.9.2009 (Core)

Plesk Obsidian 18.0.32 Update1

PHP-FPM 7.4.13

MariaDB 10.5.8



Can someone help me?


Thank You!
Was you able to fix that issue?
I'm facing the same problem.
Even when I run the command: sudo chown -R redis:www-data /var/run/redis
If I restart redis-server
the folder /var/run/redis owner becomes: redis redis again
drwxr-sr-x 2 redis redis
and files inside is the same:
srwxrwxr-x 1 redis redis 0 Oct 4 21:34 redis-server.sock
 
Edit /etc/group. In the line that starts with redis, append "www-data".
e.g.:
redis:x:123:wwwadmin,www-data
See also: `man 5 group`
 
Back
Top