This presumes that Apache, Nextcloud and Redis have already been installed, with Redis running on the default TCP port 6379 and Nextcloud is configured to use that port.
When switching from using a port to using a socket, any “Redis Server Went Away” issues that crop up in Nextcloud are probably due to file permissions: Apache’s www-data user needs access to Redis’ socket file inside /var/run/redis. Here’s the full list of steps I took to make it work:
- open
${NEXTCLOUD_WWW_ROOT}/config/config.phpin a text editor - turn on maintenance mode by setting
'maintenance' => trueand saving the file - in the
'redis'array,- set
'host' => '/var/run/redis/redis.sock' - set
'port' => 0
- set
- save changes
- open
/etc/redis/redis.confin a text editor - change
port 6379toport 0 - uncomment
unixsocket /var/run/redis/redis.sock - uncomment
unixsocketperm 700 - change
unixsocketperm 700tounixsocketperm 770 - save changes
sudo adduser www-data redissudo systemctl restart apache2(for the added group to take effect)sudo systemctl restart redis-server- open
${NEXTCLOUD_WWW_ROOT}/config/config.phpin a text editor - turn off maintenance mode by setting
'maintenance' => falseand saving the file
There’s no need to change the value of open_basedir, or to tweak Apache’s site configuration (but do remember step #12 above: restart Apache after adding www-data to the redis group).