Nextcloud

From RVM Wiki
Revision as of 12:57, 27 September 2021 by Gabriele.vivinetto (talk | contribs)
Jump to navigation Jump to search

Abilitare login imap

cd /var/www/nextcloud
sudo -u www-data /usr/bin/php occ app:install user_external 
vi config/config.php
  'user_backends' =>
  array (
    0 =>
    array (
      'class' => 'OC_User_IMAP',
      'arguments' =>
      array (
        0 => 'assistenza.rvmgroup.it',
        1 => 993,
        2 => 'ssl',
        3 => '',
        4 => false,
        5 => false,
      ),
    ),
  ),

Abilitare cache minimale

vi config/config.php
'memcache.local' => '\OC\Memcache\APCu',

Abilitare well-known caldav e carddav

Se si installa in /nextcloud, occorre impostare questo

Your web server is not properly set up to resolve “/.well-known/caldav”. Further information can be found in the documentation 27.

Edit File:

vi /etc/apache2/sites-enabled/default-ssl.conf

Add lines between </VirtualHost> and </IfModule>:

<Directory /var/www/nextcloud>
    AllowOverride All
</Directory>
Redirect 301 /.well-known/carddav /nextcloud/remote.php/dav
Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav


vi config/config.php
 'overwrite.cli.url' => 'https://server.example.com/nextcloud',
 'htaccess.RewriteBase' => '/nextcloud',
sudo -u www-data php occ maintenance:update:htaccess

Impostazione PHP Memory limit

  • Questa modifica va fatta ad ogni upgrade:
vi .htaccess
php_value post_max_size 512M
php_value memory_limit 512M

Impostazione HSTS header

  • Questa modifica va fatta ad ogni upgrade:
vi .htaccess
<IfModule mod_headers.c>
  Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>


Impostazione cron job

vi /etc/cron.d/nextcloud
*/15  *  *  *  * www-data       cd /var/www/nextcloud/ && /usr/bin/php --define apc.enable_cli=1 -f /var/www/nextcloud/cron.php

Esecuzione occ

cd /var/www/nextcloud/ && sudo -u www-data php --define apc.enable_cli=1 occ command:to:execute

Upgrade

cd  /var/www/nextcloud/ && sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/updater/updater.phar
cd  /var/www/nextcloud/ && sudo -u www-data php --define apc.enable_cli=1 occ upgrade

Ottenere l'ultima versione di nextcloud con uo script

wget -q -O - https://download.nextcloud.com/server/releases/ | grep -v latest | grep '.zip<'| cut -f 7 --delimiter='>'| cut -f 1 --delimiter='<' | cut -f 2 --delimiter='-' | sed -e 's/.zip//' | sort -n | tail -n1
22.1.1

Riferimenti