serveur_hebergement:nextcloud_et_collabora_online

Ceci est une ancienne révision du document !


Nextcloud et Collabora Online

Nextcloud est un logiciel libre qui permet d'héberger des fichiers soit personnels soit en mode collaboratif. Vous pouvez donc y stockez vos fichiers mais aussi, grâce à une multitude d'application, vos mails, votre musique, vos recette de cuisines, vos notes, accéder à Matrix, etc. Vous pouvez également créer et modifier des tableurs et fichiers docx/odt via Collabora Online.

Je vais installer Nextcloud et Collabra Online sur mon Raspberry Pi 4 ARM64 (Collabora Online ne fonctionne pas sur ARM 32 bits)

Il vous faut donc un serveur Linux (basé sur Debian dans mon cas) en 64 bits, MySQL ou PostgreSQL, un serveur web (Apache2 ou Nginx) et PHP.

Pour mon cas, je vais utiliser un Raspberry Pi 4 sous Raspbian ARM64, MySQL et avec Apache2 comme serveur web. Je ne traiterai pas ici de l'installation de Apache2 et MySQL ni de la configuration des certificats SSL déjà traité ici.

Commençons par installer les dépendances :

sudo aptitude install libxml2 php php-curl php-cli php-mysql php-gd php-common php-xml php-json php-intl php-pear php-imagick php-dev php-common php-mbstring php-zip php-soap php-bz2 php-bcmath php-gmp php-apcu unzip

On va activer le module apcu qui va gérer le cache de Nextcloud. Ouvrez le fichier php.ini :

sudo nano /etc/php/7.4/cli/php.ini

Dans la partie Dynamic Extensions, ajoutez la ligne suivante :

apc.enable_cli=1

Téléchargez la dernière version de Nextcloud :

cd /var/www/
sudo wget https://download.nextcloud.com/server/releases/latest.zip
sudo unzip latest.zip
sudo rm latest.zip

Mettez l'utilisateur www-data propriétaire du répertoire nextcloud :

sudo chown -R www-data:www-data nextcloud

Lancez MySQL :

sudo mysql -u root

Créez la base de données :

CREATE DATABASE nextcloud;

Créez l'utilisateur (changez le mot de passe) :

CREATE USER nextcloud@localhost IDENTIFIED BY 'motdepasse';

Donnez les droits à l'utilisateur sur la base de données nextcloud :

GRANT ALL PRIVILEGES ON nextcloud.* TO nextcloud@localhost;

Rechargez les privilèges :

FLUSH PRIVILEGES;

Quittez MySQL :

exit

Créez le fichier de configuration Apache2 (remplacez le nom de domaine) :

sudo nano /etc/apache2/sites-available/nextcloud.domaine.fr.conf

Ajoutez-y les lignes suivantes (modifiez le nom de domaine et le chemin des certificats SSL) :

<VirtualHost *:80>
 
        DocumentRoot /var/www/nextcloud/
 
        ServerName nextcloud.domaine.fr
        ServerAdmin fate@domaine.fr
 
        Redirect / https://nextcloud.domaine.fr/
 
</VirtualHost>
 
 
<VirtualHost *:443>
 
        DocumentRoot /var/www/nextcloud/
 
        ServerName nextcloud.domaine.fr
        ServerAdmin fate@domaine.fr
 
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/nextcloud.access.log combined
        ErrorLog ${APACHE_LOG_DIR}/nextcloud.error.log
 
        <IfModule mod_ssl.c>
                SSLEngine on
                SSLCertificateFile /etc/letsencrypt/live/domaine.fr/fullchain.pem
                SSLCertificateKeyFile /etc/letsencrypt/live/domaine.fr/privkey.pem
                #Header set Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; connect-src 'self'; media-src 'self'; child-src 'self'; object-src 'self'; form-action 'self'; img-src 'self' * data:"
        </IfModule>
 
 
        <Directory /var/www/nextcloud/>
                Options +FollowSymlinks
                AllowOverride All
 
                <IfModule mod_dav.c>
                        Dav off
                </IfModule>
 
                SetEnv HOME /var/www/nextcloud
                SetEnv HTTP_HOME /var/www/nextcloud
        </Directory>
 
</VirtualHost>
 
# modern configuration, tweak to your needs
SSLProtocol             all -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite          ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
SSLHonorCipherOrder     on
SSLCompression          off
SSLSessionTickets       off
 
# OCSP Stapling, only in httpd 2.3.3 and later
SSLUseStapling          on
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
SSLStaplingCache        shmcb:/var/run/ocsp(128000)

Activez le fichier de configuration (modifiez le nom de domaine) :

sudo a2ensite nextcloud.domaine.fr.conf

Redémarrez Apache2 :

sudo systemctl restart apache2.service

APCu

APCu is a data cache, and it is available in most Linux distributions. On Red Hat/CentOS/Fedora systems install php-pecl-apcu. On Debian/Ubuntu/Mint systems install php-apcu.

After restarting your Web server, add this line to your config.php file:

'memcache.local' ⇒ '\OC\Memcache\APCu',

Refresh your Nextcloud admin page, and the cache warning should disappear.

Warning

APCu is disabled by default on CLI which could cause issues with nextcloud’s cron jobs. Please make sure you set the apc.enable_cli to 1 on your php.ini config file or append –define apc.enable_cli=1 to the cron job call.

Sources : https://www.howtoforge.com/how-to-install-nextcloud-on-debian-11/ https://docs.nextcloud.com/server/latest/admin_manual/

Vous pourriez laisser un commentaire si vous étiez connecté.
  • serveur_hebergement/nextcloud_et_collabora_online.1664899735.txt.gz
  • Dernière modification : 2023/08/08 14:01
  • (modification externe)