Really Struggling with NextCloud REDIS Configuration

alrnetwork

Verified User
Joined
Feb 12, 2021
Messages
164
Location
Europe UTC+2
Nextcloud version: 25.0.0
Operating system and version: 22.04.1 LTS
Apache or nginx version: Apache/2.4.54 (Unix)
PHP version: PHP 8.1.11

For the life of me, I cannot figure out how to set up NextCloud to leverage REDIS on my server.

I'm using DirectAdmin and I am running the REDIS plugin, which is working fine for all other websites which are leveraging it.

However, I just cannot figure out that config file and I'm not stupid.. it just seems that there's either information missing or implied that the information should be "obvious".

As per the documentation, I am adding the following lines into my config.php file:


PHP:
'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => [
     'host'     => '/run/redis/redis-server.sock',
     'port'     => 0,
     'dbindex'  => 0,
     'password' => 'secret',
     'timeout'  => 1.5,
],


and modifying it, to point to the right place and to remove the password, as there is none, therefore, looking like this:

PHP:
'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => [
     'host'     => '/home/XXXXX/.redis/redis.sock',
     'port'     => 6379,
     'dbindex'  => 1,
     'timeout'  => 1.5,
],

I have changed the user folder for security.

Once saving this, the website simply says:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the webserver log.

I have also looked at the config-sample.php but that's just a huge massive mess of ridiculously over complicated text poorly formatted and sincerely time wasting.

I also added the following line on it's own:

'memcache.locking' => '\OC\Memcache\Redis',

And received the same Internal Server Error message.

I've checked that REDIS is running:

```
root@srv1:~# ps ax | grep redis
992 ? Ssl 1:18 /usr/local/bin/redis-server unixsocket:/home/XXXXX/.redis/redis.sock
999 ? Ssl 0:17 /usr/local/bin/redis-server unixsocket:/home/2XXXXX2/.redis/redis.sock
20609 pts/0 S+ 0:00 grep --color=auto redis
```

I literally can't get my head around this and would really need someone to provide some assistance..
This is also being asked on the NextCloud support pages here https://help.nextcloud.com/t/really-struggling-with-redis-configuration/147783/5
 
you must setting as unit socket, not "host, port". but I never using nextcloud so I don't know how to set.
possible try just set port to "0" to tell App that it unit-sockrt.
 
Today I have played with this for NC and for future use here are the steps to enable this on DA with ProPack

Code:
cd /usr/local/directadmin/custombuild
./build set redis yes
./build set php_redis yes
./build redis
./build php_redis

Enable Redis on the package of the user >> important >> Go to the user panel of that user and Enable it ! (this is not enabled by default !)

Go to config file of Nextcloud and add

Code:
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\Redis',
'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => array(
     'host' => '/home/XXXXX/.redis/redis.sock',
     'port' => 0,
     'timeout' => 0.0,
      ),

replace XXXXX with username of that account

Now your NC is working with Redis :)
 
Back
Top