Passer au contenu principal

Configuration Nextcloud

Machine VM

  • Ubuntu 21.04
  • 2vCPU
  • 2Go de RAM
  • 300 Go de disque

Installation des pré-requis

apt install apache2 mariadb-server php-fpm
apt install php-fpm php-common php-mbstring php-xmlrpc php-soap php-gd php-mysql php-xml php-intl php-mysql php-cli php-ldap php-zip php-curl php-apcu php-cas php-bz2 php-imap php-tidy
apt-get install libmagickcore-6.q16-6-extra

Configuration MariaDB

CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'nextcloud';
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Activation modules PHP-FPM

# Activation des modules PHP-CGI
a2enmod proxy_fcgi
a2enconf php7.4-fpm.conf

# Activation des modules HTTPS
a2enmod ssl
a2enmod rewrite
a2enmod headers
a2enmod socache_shmcb

# Relancer le service apache
systemctl restart apache2

Configuration Apache

<VirtualHost *:80>
# Racine Web
DocumentRoot /var/www/nextcloud

# Bloc configuration Application
   <Directory /var/www/nextcloud>
        Options ExecCGI FollowSymlinks MultiViews
        AllowOverride All
        Require all granted
        <IfModule mod_dav.c>
        Dav off
        </IfModule>
   </Directory>

# Emplacements des logs
  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>