본문 바로가기
IT

nextcloud memcache redis 설치

by Oh.mogilalia 2018. 5. 12.

Once installed, we’ll now install APCu and Redis:

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

6.2. Enable caching

The difference in speed between a Nextcloud server without cache and one with is huge. Particularly as the file and folder counts increase and more multimedia files make their way onto the server, caching becomes increasingly important for maintaining speed and performance. ACPu will handle a lot of the caching initially, leaving Redis to manage file locking. As the server grows and ACPu demands more resources, we could configure Redis to take a more active role in distributed caching. Having installed both APCu and Redis earlier, we’ll now configure them.

First, open the Redis configuration file at /etc/redis/redis.conf

sudo nano /etc/redis/redis.conf

Now, find and change:

Then uncomment: 주석 제거

port 6379

unixsocket /var/run/redis/redis.sock

unixsocketperm 770

Save and quit, then add the Apache user www-data to the redis group:

sudo usermod -a -G redis www-data

Finally, restart Apache with:

sudo service apache2 restart

And start Redis server with:

sudo service redis-server start

With Redis configured, we can add the caching configuration to the Nextcloud config file:

sudo nano /home/mogibu/apm/www/nextcloud/config/config.php

Add the following:

'memcache.local' => '\OC\Memcache\APCu',

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

'filelocking.enabled' => 'true',

'redis' => array (

'host' => '/var/run/redis/redis.sock',

'port' => 6379,

'timeout' => 0.0,

),

A reboot may be required before the configuration change takes effect, but before we do we’ll make sure Redis is enabled to start on boot with:

sudo systemctl enable redis-server

Caching is now configured.

출처 https://bayton.org/docs/nextcloud/installing-nextcloud-on-ubuntu-16-04-lts-with-redis-apcu-ssl-apache/

'IT' 카테고리의 다른 글

USB-HDD 마운트  (0) 2018.05.18
워드프레스 한국어 버전으로 변경  (0) 2018.05.14
plex media server 백업 제외  (0) 2018.05.09
우분투 서버 커널 업그레이드  (1) 2018.05.09
db log 파일 삭제  (0) 2018.05.08