« Nextcloud » : différence entre les versions
Apparence
(38 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 10 : | Ligne 10 : | ||
<kode lang='bash'> | <kode lang='bash'> | ||
# | # stop the web service | ||
sudo - | # nginx | ||
sudo rm /etc/nginx/sites-enabled/nextcloud.conf | |||
sc-reload nginx | |||
# disable cron task | # disable cron task | ||
Ligne 17 : | Ligne 19 : | ||
# backup | # backup | ||
sudo tar czf /tmp/nextcloud.tar.gz nextcloud | #sudo tar czf --totals=USR1 /tmp/nextcloud.tar.gz nextcloud | ||
sudo mariadb-dump -x -e -B nextcloud -r /var/mariadb/dump/nextcloud.sql | sudo mariadb-dump -x -e -B nextcloud -r /var/mariadb/dump/nextcloud.sql | ||
# download the latest Nextcloud Server release | # download the latest Nextcloud Server release | ||
wget https://download.nextcloud.com/server/releases/nextcloud- | wget https://download.nextcloud.com/server/releases/nextcloud-27.0.2.tar.bz2 | ||
# unpack it | # unpack it | ||
tar | tar xjf nextcloud-*.tar.bz2 | ||
# | # backup nexcloud folder and move the new one | ||
mv /var/www/nextcloud /var/www/nextcloud | sudo mv /var/www/nextcloud /var/www/nextcloud.bak | ||
mv ~/download/nextcloud /var/www | sudo mv ~/download/nextcloud /var/www | ||
# copy the config | # copy the config | ||
cp /var/www/nextcloud | sudo cp /var/www/nextcloud.bak/config/config.php /var/www/nextcloud/config | ||
# copy the data folder | # copy the data folder | ||
cp /var/www/nextcloud | sudo cp -r /var/www/nextcloud.bak/data /var/www/nextcloud | ||
# | # copy the missing apps (calendar, deck, mail) | ||
sudo cp -r /var/www/nextcloud.bak/apps/[app-name] /var/www/nextcloud/apps | |||
chown -R www-data:www-data /var/www/nextcloud/ | |||
# adjust file ownership to finalize the upgrade | |||
sudo chown -R www-data:www-data /var/www/nextcloud | |||
# restart the web service | |||
# nginx | |||
sudo ln -s /etc/nginx/sites-available/nextcloud.conf /etc/nginx/sites-enabled/nextcloud.conf | |||
sc-reload nginx | |||
# upgrade with the www-data user | # upgrade with the www-data user | ||
cd /var/www/nextcloud | cd /var/www/nextcloud | ||
sudo -u www-data php occ upgrade | sudo -u www-data php occ upgrade | ||
# set maintenance mode off | # set maintenance mode off | ||
sudo -u www-data php occ maintenance:mode --off | sudo -u www-data php occ maintenance:mode --off | ||
# adjust file ownership and permissions | |||
sudo chown -R root:root . | |||
sudo chown -R www-data:www-data apps/ config/ data/ | |||
sudo chmod 750 config/ data/ | |||
# restart php-fpm | |||
sc-restart php8.2-fpm.service | |||
# enable cron task | # enable cron task | ||
Ligne 56 : | Ligne 69 : | ||
{{info | Check the version | {{info | Check the version | ||
<syntaxhighlight lang='bash' inline>sudo -u www-data php occ -V</syntaxhighlight>}} | |||
{{warn | Version may not be immediately updated on {{boxx|<nowiki>https://nextcloud.domain.net/status.php</nowiki>}} and | |||
# login with an admin account | # login with an admin account | ||
# click on user logo on top right | # click on user logo on top right ̣→ Administration Settings}} | ||
* [https://scan.nextcloud.com Nextcloud Security Scan] | * [https://scan.nextcloud.com Nextcloud Security Scan] | ||
Ligne 259 : | Ligne 273 : | ||
=== Create a php-fpm pool === | === Create a php-fpm pool === | ||
<filebox fn='/etc/php/8.2/fpm/pool.d/nextcloud.conf' collapsed> | <filebox fn='/etc/php/8.2/fpm/pool.d/nextcloud.conf' lang='ini' collapsed> | ||
[nextcloud] | [nextcloud] | ||
Ligne 270 : | Ligne 284 : | ||
pm = ondemand | pm = ondemand | ||
pm.max_children = | pm.max_children = 3 ; # cores - 1 | ||
pm.process_idle_timeout = 60s | pm.process_idle_timeout = 60s | ||
env[HOSTNAME] = $HOSTNAME | env[HOSTNAME] = $HOSTNAME | ||
Ligne 284 : | Ligne 298 : | ||
php_value[opcache.jit] = 1255 | php_value[opcache.jit] = 1255 | ||
php_value[opcache.jit_buffer_size] = 128M | php_value[opcache.jit_buffer_size] = 128M | ||
php_value[opcache.interned_strings_buffer] = | php_value[opcache.interned_strings_buffer] = 64 | ||
php_value[opcache.memory_consumption] = 256 | |||
</filebox> | </filebox> | ||
Ligne 290 : | Ligne 305 : | ||
# get the PATH var | # get the PATH var | ||
sudo -u www-data printenv PATH | sudo -u www-data printenv PATH | ||
# restart php8.2-fpm service to create the /run/php/php8.2-fpm-nextcloud.sock socket | |||
sc-restart php8.2-fpm.service | |||
</kode> | </kode> | ||
Ligne 460 : | Ligne 478 : | ||
<filebox fn='config/config.php'> | <filebox fn='config/config.php'> | ||
'memcache.local' => '\OC\Memcache\APCu', | 'memcache.local' => '\OC\Memcache\APCu', | ||
</filebox> | |||
== [https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#maintenance-window-start Server has no maintenance window start time configured] == | |||
<filebox fn='config/config.php'> | |||
'maintenance_window_start' => 1, | |||
// 1: will only run the background jobs between 01:00am UTC and 05:00am UTC. | |||
// 100: (defaults) disables the feature | |||
</filebox> | </filebox> |
Dernière version du 10 novembre 2024 à 09:44
Links
Manual upgrade
![]() |
Updates between multiple major versions and downgrades are unsupported. |
Backup the database, the data directory and the config.php file.
# stop the web service
# nginx
sudo rm /etc/nginx/sites-enabled/nextcloud.conf
sc-reload nginx
# disable cron task
sudo crontab -u www-data -e
# backup
#sudo tar czf --totals=USR1 /tmp/nextcloud.tar.gz nextcloud
sudo mariadb-dump -x -e -B nextcloud -r /var/mariadb/dump/nextcloud.sql
# download the latest Nextcloud Server release
wget https://download.nextcloud.com/server/releases/nextcloud-27.0.2.tar.bz2
# unpack it
tar xjf nextcloud-*.tar.bz2
# backup nexcloud folder and move the new one
sudo mv /var/www/nextcloud /var/www/nextcloud.bak
sudo mv ~/download/nextcloud /var/www
# copy the config
sudo cp /var/www/nextcloud.bak/config/config.php /var/www/nextcloud/config
# copy the data folder
sudo cp -r /var/www/nextcloud.bak/data /var/www/nextcloud
# copy the missing apps (calendar, deck, mail)
sudo cp -r /var/www/nextcloud.bak/apps/[app-name] /var/www/nextcloud/apps
# adjust file ownership to finalize the upgrade
sudo chown -R www-data:www-data /var/www/nextcloud
# restart the web service
# nginx
sudo ln -s /etc/nginx/sites-available/nextcloud.conf /etc/nginx/sites-enabled/nextcloud.conf
sc-reload nginx
# upgrade with the www-data user
cd /var/www/nextcloud
sudo -u www-data php occ upgrade
# set maintenance mode off
sudo -u www-data php occ maintenance:mode --off
# adjust file ownership and permissions
sudo chown -R root:root .
sudo chown -R www-data:www-data apps/ config/ data/
sudo chmod 750 config/ data/
# restart php-fpm
sc-restart php8.2-fpm.service
# enable cron task
sudo crontab -u www-data -e
|
![]() |
Check the version
sudo -u www-data php occ -V |
![]() |
Version may not be immediately updated on https://nextcloud.domain.net/status.php and
|
Configuration
NGINX
/etc/nginx/sites-available/nextcloud.conf |
Create a php-fpm pool
/etc/php/8.2/fpm/pool.d/nextcloud.conf |
# get the PATH var
sudo -u www-data printenv PATH
# restart php8.2-fpm service to create the /run/php/php8.2-fpm-nextcloud.sock socket
sc-restart php8.2-fpm.service
|
Apache
/etc/apache2/sites-available/nextcloud.conf |
Pretty URL
config/config.php |
'overwrite.cli.url' => 'https://nextcloud.domain.fr/',
'htaccess.RewriteBase' => '/',
|
sudo -u www-data php /var/www/nextcloud/occ maintenance:update:htaccess |
Server tuning
MariaDB
Increase the cache of Mariadb so it won't use swap partition when it receives a burst of requests. !!! OPTIONAL !!!
/etc/mysql/conf.d/mysql.cnf |
[mysqld]
innodb_buffer_pool_size = 1G
innodb_io_capacity = 4000
|
-- get value in GB
SELECT @@innodb_buffer_pool_size/1024/1024/1024; -- default 128 MB
SELECT @@innodb_io_capacity; -- default 200
|
![]() |
Get the best value for innodb_buffer_pool_size |
Background jobs
# edit crontab for user www-data
sudo crontab -u www-data -e
# run cron.php every 5 minutes
*/5 * * * * php -f /var/www/nextcloud/cron.php
|
With admin account, change the Settings → Administration → Basic settings → Background jobs = Cron
Settings
Resetting a lost admin password
# change the admin password
sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin
|
Email server
Setting | Value |
---|---|
Send mode | SMTP |
Authentication method |
|
Authentication required | use same credential as for roundcube |
Server address | smtp.domain.fr:25 |
Apps
Installer des Apps:
- se connecter en admin
- cliquer sur l'icone du profile en haut à droite → Apps
Deck
Outils de gestion de taches similaire à Trello
Key | Value |
---|---|
IMAP host | hostname.domain.net |
IMAP security | STARTTLS |
IMAP port | 143 |
SMTP host | hostname.domain.net |
SMTP security | STARTTLS |
SMTP port | 25 |
Talk
Chat, video & audio calls
Calendar
Installation sur Ubuntu 18.04
wget https://download.nextcloud.com/server/releases/latest-27.tar.bz2
tar xf latest-*.tar.bz2
sudo mv -T nextcloud /var/www/nextcloud
sudo chown -R root:root /var/www/nextcloud
# vérifier que les modules php suivant sont bien installés
dpkg -l php-zip php-gd php-curl php-imagick
# folders rights
sudo chown -R www-data:www-data apps
sudo chown -R www-data:www-data config
sudo chown -R www-data:www-data data
sudo chmod 750 config
|
create database nextcloud;
grant all privileges on nextcloud.* to 'nextcloud'@'localhost' identified by 'password';
flush privileges;
|
Errors
Memcache \OC\Memcache\APCu not available for local cache
/etc/php/7.4/mods-available/apcu.ini |
apc.enable_cli=1
|
The PHP memory limit is below the recommended value of 512MB
/etc/php/7.4/apache2/php.ini |
memory_limit = 512M
|
MySQL is used as database but does not support 4-byte characters
A memcache is not required and you may safely ignore the warning if you prefer
config/config.php |
'memcache.local' => '\OC\Memcache\APCu',
|
Server has no maintenance window start time configured
config/config.php |
'maintenance_window_start' => 1,
// 1: will only run the background jobs between 01:00am UTC and 05:00am UTC.
// 100: (defaults) disables the feature
|