DYSW
October 19, 2019, 1:40pm
1
Hey all
Im having some issues with config.php and redis. I hope someone can help. Apache delivers fine on the main domain.com , but not on the subdirectory with nextcloud in it.
When enabled im getting this message when accessing the site
https://defuse.ca/b/HyBQbfJ5O3SFcv4L5fMnG2
Config.php
https://defuse.ca/b/ZcloaPW2yaGsIBuSzkDksd
Test that redis is working on the socket
https://defuse.ca/b/td2IzGOl4qqVNRanA7fZp6
Does your webserver user have access to the redis socket? It might not be able to open /var/run…
This is my Redis configuration. I’m also using memcache on redis so that cli (cron jobs) also use Redis cache)
config.php
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/tmp/redis.sock',
'port' => 0,
'timeout' => 0,
'dbindex' => 0,
),
redis.conf
unixsocket /tmp/redis.sock
unixsocketperm 774
ls -laF /tmp/redis.sock
srwxrwxr-- 1 apache apache 0 Oct 19 15:37 /tmp/redis.sock=
j-ed
October 19, 2019, 2:31pm
3
I cannot see any related message which points to a Redis problem.
How do you know your problem is related to it?
Have you tried to use the array() syntax instead of using square brackets (I don’t know if it matters, but it is worse a try), like e.g.
YOUR SYNTAX: USUAL SYNTAX:
'redis' => [ redis' => array (
'host' => ... 'host' => ...
... ...
), ),
Have you checked the socket access rights of the Redis socket as described here:
welll This didnt work either … all I got was a white screen after doing this. Similar to the other guides I have tried
Have you tried to access Redis using the network interface, like
'redis' => array (
'host' => 'localhost',
'port' => 6379,
'timeout' => 0.0,
),
DYSW
October 19, 2019, 2:47pm
4
Afk. But I added redis (uid) to the http group. Permissions on /var/run/redis/redis.sock shows redis redis. Both redis and http needs write access as I understand.
Thank u very much for sharing
DYSW
October 19, 2019, 2:50pm
5
Brackets or not, same problem. Network interface works fine. But it’s a bit slower, so I wanted to try the socket solution.
DYSW
October 19, 2019, 6:07pm
6
It works now. It was the permissions on the socket. needs to be owned and writeable by the webserver. BUT now I got another problem
When redis restarts it changes the ownership of the socket file.
Proof
https://defuse.ca/b/1tccBNG5j3iPEWOcbLaImQ
j-ed
October 19, 2019, 6:49pm
7
I just reconfigured my server to use the socket and it works seamlessly.
made sure that the redis.conf file contains the following lines:unixsocket /var/run/redis.sock
unixsocketperm 0770
restarted Redis server and checked the access rights:# ls -al /var/run/redis.sock
srwxrwx--- 1 redis redis 0 Oct 19 16:54 /var/run/redis.sock
added the web server user to the redis group.
made sure that the Nextcloud config.php file contains the following lines:'redis' =>
array (
'host' => '/var/run/redis.sock',
'port' => 0,
'timeout' => 0.0
),
restarted the web server
tested the Nextcloud access by executing e.g. an occ command.