Installation Nextcloud

19 mars 2021 Non Par nospheratus
Nextcloud — Wikipédia

 Sur Ubuntu Serveur 18.04 LTS.

Installation des paquets :

  • apt-get install software-properties-common
  • apt-key adv –fetch-keys ‘https://mariadb.org/mariadb_release_signing_key.asc’
  • add-apt-repository ‘deb [arch=amd64,arm64,ppc64el] https://ftp.igh.cnrs.fr/pub/mariadb/repo/10.3/ubuntu bionic main’
  • apt update
  • apt install mariadb-server apache2 vim less bzip2 locate –y
  • apt-get install software-properties-common
  • add-apt-repository ppa:ondrej/php
  • apt-get update
  • apt-get install php7.4 php7.4-common php-dompdf php-xml php7.4-xml php7.4-gd php7.4-cgi php7.4-cli php7.4-fpm php7.4-phpdbg php7.4-json libapache2-mod-php7.4  libxmlb1  stetl php7.4-mbstring openssl php-xml php-xmlrpc php7.4-bz2 php7.4-zip zip bzip2 php7.4-mysql php-mysql php7.4-apcu php7.4-apcu-bc php7.4-gettext php7.4-igbinary php7.4-imagick php7.4-memcache php-pear php7.4-redis php7.4-intl php7.4-bcmath php7.4-gmp imagemagick

Configuration Apache

vi /etc/apache2/sites-available/nextcloud.conf

Alias /nextcloud « /var/www/nextcloud/ »

<Directory /var/www/nextcloud/>

  Require all granted

  AllowOverride All

  Options FollowSymLinks MultiViews

  <IfModule mod_dav.c>

    Dav off

  </IfModule>

</Directory>

<VirtualHost *:80>

ServerName nextcloud.nosland.com

RewriteEngine on

RewriteCond %{SERVER_NAME} =nextcloud.nosland.com

RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

</VirtualHost>

<VirtualHost *:443>

  DocumentRoot /var/www/nextcloud/

  ServerName  nextcloud.nosland.com

  <Directory /var/www/nextcloud/>

    Require all granted

    AllowOverride All

    Options FollowSymLinks MultiViews

    <IfModule mod_dav.c>

      Dav off

    </IfModule>

<IfModule mod_headers.c>

      Header always set Strict-Transport-Security « max-age=15552000; includeSubDomains »

    </IfModule>

  </Directory>

</VirtualHost>

Créer le dossier du site : mkdir /var/www/nextcloud/

Activation des modules complémentaires :

a2ensite nextcloud.conf

a2enmod rewrite

a2enmod headers

a2enmod env

a2enmod dir

a2enmod mime

a2enmod setenvif

a2enmod ssl service apache2 reload

Téléchargement des sources

 cd /tmp/

wget https://download.nextcloud.com/server/releases/nextcloud-21.0.0.zip

cp nextcloud-21.0.0.zip /var/www/

cd /var/www/

unzip nextcloud-21.0.0.zip

chown -R www-data:www-data /var/www/nextcloud/

Création de la base de données

mysql -u root –p

create database nextcloud ;

quit ;

Installation du certificat SSL Server

add-apt-repository ppa:certbot/certbot

apt-get update

apt install python-certbot-apache

certbot –apache -d store1.digitaltides.fr

/etc/init.d/apache2 restart

systemctl status certbot.timer  (verifie le renew automatique)