installation/nextcloud_itopie.md: doc done authored by Donna Sayed's avatar Donna Sayed
......@@ -71,8 +71,8 @@
### Installation de Nginx
1. Installer nginx : `# apt install nginx`
1. Ajouter la configuration suivante dans /etc/nginx/sites-available/${WebsiteName.tld} \
**ATTENTION**, variable à modifier par le nom du service : ${WebsiteName.tld} !
1. Ajouter la configuration suivante dans /etc/nginx/sites-available/${WEBSITENAME.TLD} \
**ATTENTION**, variable à modifier par le nom du service : ${WEBSITENAME.TLD} !
```
upstream php-handler {
#server 127.0.0.1:9000;
......@@ -89,10 +89,10 @@
server {
listen 80;
listen [::]:80;
server_name ${WebsiteName.tld};
server_name ${WEBSITENAME.TLD};
access_log /var/log/nginx/${WebsiteName.tld}.access.log;
error_log /var/log/nginx/${WebsiteName.tld}.error.log;
access_log /var/log/nginx/${WEBSITENAME.TLD}.access.log;
error_log /var/log/nginx/${WEBSITENAME.TLD}.error.log;
# Prevent nginx HTTP Server Detection
server_tokens off;
......@@ -104,7 +104,7 @@
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ${WebsiteName.tld};
server_name ${WEBSITENAME.TLD};
# Path to the root of your installation
root /srv/nextcloud;
......@@ -115,8 +115,8 @@
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
# Logs
access_log /var/log/nginx/${WebsiteName.tld}.access.log;
error_log /var/log/nginx/${WebsiteName.tld}.error.log;
access_log /var/log/nginx/${WEBSITENAME.TLD}.access.log;
error_log /var/log/nginx/${WEBSITENAME.TLD}.error.log;
# Prevent nginx HTTP Server Detection
server_tokens off;
......@@ -263,88 +263,185 @@
1. Redémarrer NGINX : `# systemctl restart nginx.service`
### Installation de PostgreSQL
!!!!! CHECK DROITS DES FICHIERS ET DOSSIERS
## PostgreSQL
Installer les paquets
# apt-get install postgresql postgresql-client
Créer l'utilisateur et la base de donnée
# sudo -u postgres psql -d template1
template1=# CREATE USER nextcloud CREATEDB;
template1=# CREATE DATABASE nextcloud OWNER nextcloud;
template1=# \password nextcloud
template1=# \q
[source](https://wiki.debian.org/PostgreSql)
## Installation Nextcloud
Télécharger et décompresser les fichiers
1. Installer les paquets : `# apt install postgresql postgresql-client`
1. Créer la base de données et l'utilisateur
```
# sudo -u postgres psql
postgres=# create database nextcloud;
postgres=# create user ncadmin with encrypted password '${ncadmin_DB_PASSWORD}';
postgres=# grant all privileges on database nextcloud to ncadmin;
```
1. Configurer la connexion en socket
```
# nano /etc/postgresql/15/main/pg_hba.conf
```
- Tout au début de la section "local", ajouter :
```
local nextcloud all ident map=nextcloud
```
- Le compte de base de données nextcloud a tous les droits localement pour la connexion en socket. Le mapping se fait dans un autre fichier : pg_ident.conf
```
# nano /etc/postgresql/15/main/pg_ident.conf
```
- Le mapping entre les comptes POSIX et ceux de la base de données se fait à la fin du fichier :
```
# MAPNAME SYSTEM-USERNAME PG-USERNAME
nextcloud www-data ncadmin
```
### Installation de Nextcloud
1. Télécharger et décompresser les fichiers
```
# cd /srv
# wget https://download.nextcloud.com/server/releases/nextcloud-17.0.3.tar.bz2
# tar xvf nextcloud-17.0.3.tar.bz2
# chown -R www-data:www-data /srv/nextcloud
Compléter l'installation avec la commande OCC
# wget https://download.nextcloud.com/server/releases/latest-28.tar.bz2
# tar xvf latest-28.tar.bz2
# chown -R www-data:www-data /srv/nextcloud
```
1. Compléter l'installation avec la commande OCC
```
# cd /srv/nextcloud
# sudo -u www-data php occ maintenance:install --database "pgsql" --database-host "localhost:/run/postgresql" --database-name "nextcloud" --database-user "nextcloud" --database-pass "password" --admin-user "rescue" --admin-pass "password"
Nextcloud was successfully installed
Corriger la configuration générée
# nano /srv/nextcloud/config/config.php
Remplacer `localhost` par `inubo.votredomain.ch`
Puis se connecter à nextcloud via son navigateur
## Configuration du cron
# nano /etC/cron.d/nextcloud
Ajouter:
*/5 * * * * www-data php -f /srv/nextcloud/cron.php
## Memcache
### Cache local (APCu)
# apt install php7.3-apcu
Ajouter à **/srv/nextcloud/config/config.php**:
`'memcache.local' => '\OC\Memcache\APCu',`
### Redis
# apt intsall redis-server php-redis
Ajouter à **/srv/nextcloud/config/config.php**:
```
1. Corriger la configuration générée
```
# nano /srv/nextcloud/config/config.php
```
- Remplacer localhost par ${WEBSITENAME.TLD}, puis se connecter à Nextcloud via son navigateur
- Exemple du fichier config.php :
**ATTENTION**, le data directory se trouve en dehors du dossier racine nextcloud !
```
<?php
$CONFIG = array (
'passwordsalt' => 'XXXXXXXXXXXXXXX',
'secret' => 'XXXXXXXXXXXXXXXXXXXXXX',
'trusted_domains' =>
array (
0 => '${WEBSITENAME.TLD}',
1 => '${ANOTHERWEBSITENAME.TLD_ifneeded}',
),
'trusted_proxies' =>
array (
0 => '${TRUSTEDPROXIES_IP}',
0 => '${ANOTHERTRUSTEDPROXIES_IP_ifneeded}',
),
'datadirectory' => '/srv/nextcloud-data',
'dbtype' => 'pgsql',
'version' => '28.0.6.1',
'overwrite.cli.url' => 'https://${WEBSITENAME.TLD}',
'htaccess.RewriteBase' => '/',
'dbname' => 'nextcloud',
'dbhost' => '/var/run/postgresql',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'ncadmin',
'dbpassword' => '${ncadmin_DB_PASSWORD}',
'installed' => true,
'instanceid' => 'oc5hx4h6c3mk',
'memcache.local' => '\OC\Memcache\APCu', ### A AJOUTER
'memcache.distributed' => '\\OC\\Memcache\\Redis', ### A AJOUTER
'memcache.locking' => '\\OC\\Memcache\\Redis', ### A AJOUTER
'redis' => [ ### A AJOUTER
'host' => 'localhost', ### A AJOUTER
'port' => 6379, ### A AJOUTER
], ### A AJOUTER
'open_basedir' => '/dev/urandom',
'mysql.utf8mb4' => 'true',
'updater.release.channel' => 'stable',
'apps_paths' =>
array (
0 =>
array (
'path' => '/srv/nextcloud/apps',
'url' => '/apps',
'writable' => false,
),
1 => ### A AJOUTER
array ( ### A AJOUTER
'path' => '/srv/nextcloud/apps2', ### A AJOUTER
'url' => '/apps2', ### A AJOUTER
'writable' => true, ### A AJOUTER
),
),
'filelocking.enabled' => true,
'default_phone_region' => 'CH',
'ldapIgnoreNamingRules' => false,
'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
'maintenance' => false,
'loglevel' => 2,
'logfile' => '/var/log/nextcloud/nextcloud.log',
'logrotate' => 0,
'theme' => '',
'mail_from_address' => 'nextcloud',
'mail_smtpmode' => 'smtp',
'mail_sendmailmode' => 'smtp',
'mail_domain' => '${DOMAIN.TLD}',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => 1,
'mail_smtphost' => '${SMTP_HOST}',
'mail_smtpport' => '465',
'mail_smtpsecure' => 'ssl',
'mail_smtpname' => '${IT_MAIL}',
'mail_smtppassword' => '${IT_MAIL_PASSWORD}',
'maintenance_window_start' => 1,
);
```
#### Configuration du cron
```
'memcache.distributed' => '\OC\Memcache\Redis',
'redis' => [
'host' => 'localhost',
'port' => 6379,
],
'memcache.locking' => '\OC\Memcache\Redis',
# nano /etC/cron.d/nextcloud
```
- Ajouter:
```
*/5 * * * * www-data php -f /srv/nextcloud/cron.php
```
### Liste des applications usuelles
* Accessibility (base)
* Antivirus for files (protection antivirale pour les ficheirs)
* AppOrder (pour trier les applications dans le menu)
* Appointments
* Auditing / Logging (base)
* Brute-force settings
* Calendar (base)
* Collaborative tags (base)
* Comments (base)
* Contacts (base)
* Contacts Interaction (Collecte des données sur les interactions entre contacts)
* Deck (kanban)
* Deleted files (base)
* External storage support (permet de connecter un stockage externe au serveur Nextcloud)
* File access control (gestion avancée des droits)
* File sharing (base)
* First run wizard (permet d'afficher le tutoriel de base à la première connexion)
* Forms (formulaires)
* Impersonate (donne la possibilité de se connecter comme un utilisateur, avec ses droits)
* Keyweb (gesiton des fichiers kdbx)
* LDAP user and group backend (base)
* Log Reader (base)
* Monitoring (base)
* Nextcloud announcements (base)
* Nextcloud office (base)
**ATTENTION**, configurer Netxcloud office dans `Paramètres d'administration>Nextcloud office`
`Utilisez votre propre serveur : https://office.inubo.ch`
* Notifications (base)
* Password policy (base)
* PDF viewer (permet de visualiser directement un PDF dans Nextcloud web)
* Photos (base)
* Polls (formulaires et sondages)
* Privacy (base)
* Recommendations (montre les fichiers qui sont utilisés fréquemment)
* Share by mail (base)
* Suspicious Login (application de sécurité pour éviter les connexion malveillantes)
* Talk (application de chat et de visio conférence)
* Tasks (gestion des tâches en lien avec le calendrier, via CalDAV)
* Temporary files lock (permet d'éviter des conflits en verrouillant les fichiers ouverts)
* Text (base)
* Theming (permet de mettre des thèmes à l'interface web de Nextcloud)
* TimeManager (Gestion du temps)
* Two-Factor TOTP Provider
* Update notification (base)
* User status (base)
* User usage report (permet de suivre l'utilisation des ressources par utilisateur)
* Versions (base)
* Video player (base)