Problems using redis with socket for filelocking

Hi there,

I set up a new server with Debian 8.5 testing (apache 2.4, php7, redis 2.2.8, owncloud 9.04)

As recommended by the oc documentation I use APCu for local memcaching and redis for local filelocking.
When I use redis with tcp-configuration everything works fine and without problems.

But for performance reasons and maybe security reasons I would like to use socket communication for redis as described here:
OC 9.0 Doc: Transactional File Locking

First lesson I learned: Modifying the config.php (as described in the doc) is not enough and does not work:

'memcache.local' => '\OC\Memcache\APCu',
'filelocking.enabled' => true,
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'timeout' => 0.0,
),

Error-message: Redis server went away (I spent several hours to search a solution for this)

I then found out, that the socket-mode has to be enabled in the redis.conf under /etc/redis

port 0
unixsocket /var/run/redis/redis.sock
unixsocketperm 755

But now it still doesn't work.
I then tried to add the user www-data to the group redis - to eleminate permission problems - but that didn't help either.

I finally tried to add the path of the socket to php open_basedir in VirtualHost-Container:

php_value open_basedir /var/www/owncloud/:/var/run/redis/:/tmp/:/tmp

But this didn't help either but in admin panel i then got the error message

Temporary directory /tmp is not present or writable

(...even it is mentioned in open_basedir )

So now I don't know how to solve the problem.

Can somebody please help me?

I also made www-data member of the group redis, /etc/group:
redis:x:110:www-data

but you need the redis group to grant write permission, so instead of:

I use:
unixsocketperm 770

1 Like

Now I use it, too - and it works! :grin:
My mistake was that I tried to change these rights with chmod on /var/run/redis/redis.sock :confounded:

Thank you very much! :slight_smile: