bts sio → infrastructure multisite
Serveur de fichiers Nextcloud sur Debian
Nextcloud fournit le service de partage de fichiers de l'infrastructure, hébergé sur le VLAN serveurs. Installation sur Debian avec Apache et MariaDB.
Paquets et modules
sudo apt install apache2 mariadb-server libapache2-mod-php php \
php-{gd,xml,mbstring,curl,zip,intl,cli,mysql} unzip wget -y
Nextcloud a besoin de plusieurs modules Apache, notamment rewrite pour ses
URL et headers pour ses en-têtes de sécurité :
sudo a2enmod rewrite headers env dir mime ssl
sudo systemctl restart apache2
Base de données
CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY '<mot de passe>';
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
FLUSH PRIVILEGES;
L'encodage utf8mb4 n'est pas optionnel : c'est lui qui permet de stocker
correctement les noms de fichiers contenant des accents ou des emoji.
Déployer l'application
cd /tmp
wget https://download.nextcloud.com/server/releases/nextcloud-32.0.2.zip
unzip nextcloud-32.0.2.zip
sudo mv nextcloud /var/www/html/
sudo chown -R www-data:www-data /var/www/html/nextcloud
sudo chmod -R 755 /var/www/html/nextcloud
Virtualhost Apache
/etc/apache2/sites-available/nextcloud.conf :
<VirtualHost *:80>
ServerName 192.168.10.7
DocumentRoot /var/www/html/nextcloud
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
Require all granted
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/nextcloud_error.log
CustomLog ${APACHE_LOG_DIR}/nextcloud_access.log combined
</VirtualHost>
sudo a2ensite nextcloud.conf
sudo systemctl reload apache2