iMarket Digital Properties

0 %
iMarket Digital Properties Ltd
Design · Develop · Monetize · Support
  • Location:
    United Kingdom
  • City:
    London
  • Service Area:
    Global
Business Systems
Business Services
24/7 Support
Websites
Web Applications
E-commerce Solutions
Digital Platforms
Products & Services
Public & Private Networks

Configuring Memory Caching In Nextcloud

January 4, 2018

 

1. Install APCu and Redis:

$ sudo apt install php-apcu redis-server php-redis

$ sudo service apache2 restart

2. Edit the configuration file

$ sudo nano /etc/redis/redis.conf

Ctrl+w and enter “port” to search for and change:

port 6379

to

port 0

Then Ctrl+w to search for and uncomment:

unixsocket /var/run/redis/redis.sock

and uncomment the line below and change the permissions to 770:

unixsocketperm 700

to

unixsocketperm 770

Ctrl+x, the ‘Y’ to save and exit.

3. Add the Redis user redis to the www-data group:

$ sudo usermod -a -G redis www-data

4. Restart Apache:

$ sudo service apache2 restart

5. Start Redis server:

$ sudo service redis-server start

6. Add the caching configuration to the Nextcloud config file:

$ sudo nano /var/www/html/nextcloud/config/config.php

Add the following right after the last line and before the ‘);’ (before the last parenthesis and semicolon)

'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Memcached',
'redis' => 
array (
'host' => 'localhost',
'port' => 0,
'timeout' => 0.0,
),

Ctrl+x, then ‘Y’ to save and exit.

NOTE: If you are getting and Internal Server Error with the config above, please see the UPDATED comments belowhttps://kenfavors.com/code/configuring-memory-caching-in-nextcloud/#comment-8355

To verify Redis is enabled to start on boot:

$ sudo systemctl enable redis-server

Now when you go to the admin page in Nextcloud, there should no longer be a ‘Security & Setup Warning’ about memory caching not being enabled.

Also see How To Install Memcached to install Memcached if only using APCu

REFERENCES

https://docs.nextcloud.com/server/18/admin_manual/configuration_server/caching_configuration.html
https://bayton.org/docs/nextcloud/installing-nextcloud-on-ubuntu-16-04-lts-with-redis-apcu-ssl-apache/


Hosting

This web app has been tested on DigitalOcean. This app can also be installed using other hosts such as Amazon AWS, Google Cloud, Microsoft Azure, Vultr and others.

Installation & Maintenance

If you would like to get this app installed, maintained or need training, Contact Me to get current rates.

Posted in BlogTags:
Write a comment