nextcloud_dans_lxc
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| nextcloud_dans_lxc [2019/10/22 10:02] – [Création de la DB] simon | nextcloud_dans_lxc [Date inconnue] (Version actuelle) – supprimée - modification externe (Date inconnue) 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Nextcloud dans un conteneur LXC ====== | ||
| - | Article détaillé sur l' | ||
| - | Je pars d'une [[Debian]] Buster. | ||
| - | <code bash> | ||
| - | # lxc-create -t download -n nextcloud -- --dist debian --release buster --arch amd64 | ||
| - | </ | ||
| - | |||
| - | Configuration (on rajoute le démarrage automatique) : | ||
| - | <code bash> | ||
| - | # vim / | ||
| - | # cat / | ||
| - | lxc.start.auto = 1 | ||
| - | |||
| - | # Distribution configuration | ||
| - | lxc.include = / | ||
| - | lxc.arch = linux64 | ||
| - | |||
| - | # Container specific configuration | ||
| - | lxc.rootfs.path = dir:/ | ||
| - | lxc.uts.name = nextcloud | ||
| - | |||
| - | # Network configuration | ||
| - | lxc.net.0.type = veth | ||
| - | lxc.net.0.link = lxcbr0 | ||
| - | lxc.net.0.flags = up | ||
| - | lxc.net.0.hwaddr = 00: | ||
| - | </ | ||
| - | |||
| - | Pour l' | ||
| - | <code bash> | ||
| - | # vim / | ||
| - | (...) | ||
| - | dhcp-host=nextcloud, | ||
| - | </ | ||
| - | |||
| - | On redémarrer le service : | ||
| - | <code bash> | ||
| - | # systemctl restart lxc-net | ||
| - | </ | ||
| - | |||
| - | Et on démarre le conteneur : | ||
| - | <code bash> | ||
| - | # lxc-start nextcloud | ||
| - | # lxc-ls -f | ||
| - | NAME STATE | ||
| - | (...) | ||
| - | nextcloud RUNNING 1 | ||
| - | </ | ||
| - | |||
| - | ===== Installation des prérequis ===== | ||
| - | <code bash> | ||
| - | # lxc-attach nextcloud | ||
| - | |||
| - | root@nextcloud:/# | ||
| - | </ | ||
| - | |||
| - | ===== Script " | ||
| - | <code bash> | ||
| - | root@nextcloud:/# | ||
| - | |||
| - | root@nextcloud:/# | ||
| - | |||
| - | root@nextcloud:/ | ||
| - | </ | ||
| - | |||
| - | Il faut changer la version de nextcloud dans le script parce que par défaut elle est encore en 16.0.3 à l' | ||
| - | <code bash> | ||
| - | root@nextcloud:/ | ||
| - | (...) | ||
| - | // Nextcloud version | ||
| - | define(' | ||
| - | (...) | ||
| - | |||
| - | root@nextcloud:/ | ||
| - | |||
| - | root@nextcloud:/ | ||
| - | </ | ||
| - | |||
| - | Il faut configurer nginx pour qu'il pointe sur ce dossier : | ||
| - | <code bash> | ||
| - | root@nextcloud:/ | ||
| - | |||
| - | server { | ||
| - | listen 80 default_server; | ||
| - | |||
| - | root / | ||
| - | |||
| - | # Add index.php to the list if you are using PHP | ||
| - | index index.html index.htm index.php; | ||
| - | |||
| - | server_name _; | ||
| - | |||
| - | location / { | ||
| - | try_files $uri $uri/ =404; | ||
| - | } | ||
| - | |||
| - | # pass PHP scripts to FastCGI server | ||
| - | location ~ \.php$ { | ||
| - | include snippets/ | ||
| - | |||
| - | fastcgi_pass unix:/ | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | On relance nginx : | ||
| - | <code bash> | ||
| - | root@nextcloud:/ | ||
| - | </ | ||
| - | |||
| - | J'ai voulu utiliser le script " | ||
| - | Je laisse la procédure pour mémoire : | ||
| - | < | ||
| - | Il n'y a plus qu'à se rendre sur l'url qu'on a fait pointer sur le conteneur : [[https:// | ||
| - | |||
| - | Le script renseigne quelques dépendances manquantes. | ||
| - | <code bash> | ||
| - | Dependencies not found. | ||
| - | The following PHP modules are required to use Nextcloud: | ||
| - | zip | ||
| - | dom | ||
| - | XMLWriter | ||
| - | libxml | ||
| - | mb multibyte | ||
| - | GD | ||
| - | SimpleXML | ||
| - | curl | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | À installer : | ||
| - | <code bash> | ||
| - | root@nextcloud:/ | ||
| - | </ | ||
| - | |||
| - | J'ai eu un problème avec MariaDD qui ne pouvait pas démarrer parce que le service ne pouvait pas écrire dans " | ||
| - | <code bash> | ||
| - | root@nextcloud:/ | ||
| - | ● mariadb.service - MariaDB 10.3.17 database server | ||
| - | | ||
| - | | ||
| - | Docs: man: | ||
| - | | ||
| - | Process: 11940 ExecStartPre=/ | ||
| - | Process: 11941 ExecStartPre=/ | ||
| - | Process: 11943 ExecStartPre=/ | ||
| - | , status=0/ | ||
| - | Process: 11991 ExecStart=/ | ||
| - | Main PID: 11991 (code=exited, | ||
| - | | ||
| - | | ||
| - | Oct 21 16:06:27 nextcloud mysqld[11991]: | ||
| - | Oct 21 16:06:27 nextcloud mysqld[11991]: | ||
| - | Oct 21 16:06:27 nextcloud mysqld[11991]: | ||
| - | Oct 21 16:06:27 nextcloud mysqld[11991]: | ||
| - | Oct 21 16:06:27 nextcloud mysqld[11991]: | ||
| - | Oct 21 16:06:27 nextcloud mysqld[11991]: | ||
| - | Oct 21 16:06:27 nextcloud mysqld[11991]: | ||
| - | (...) | ||
| - | </ | ||
| - | |||
| - | Résolution ([[https:// | ||
| - | <code bash> | ||
| - | root@nextcloud:/ | ||
| - | |||
| - | root@nextcloud:/ | ||
| - | |||
| - | root@nextcloud:/ | ||
| - | total 109M | ||
| - | drwxr-xr-x | ||
| - | drwxr-xr-x 16 root root 4.0K Oct 19 18:32 .. | ||
| - | -rw-r----- | ||
| - | -rw-r----- | ||
| - | -rw-r--r-- | ||
| - | -rw-r----- | ||
| - | -rw-r----- | ||
| - | -rw-r----- | ||
| - | -rw-r----- | ||
| - | -rw-r----- | ||
| - | drwx------ | ||
| - | -rw-r----- | ||
| - | drwx------ | ||
| - | |||
| - | root@nextcloud:/ | ||
| - | |||
| - | root@nextcloud:/ | ||
| - | ● mariadb.service - MariaDB 10.3.17 database server | ||
| - | | ||
| - | | ||
| - | (...) | ||
| - | </ | ||
| - | |||
| - | ==== Création de la DB ==== | ||
| - | <code bash> | ||
| - | root@nextcloud:/ | ||
| - | Enter password: | ||
| - | Welcome to the MariaDB monitor. | ||
| - | Your MariaDB connection id is 36 | ||
| - | Server version: 10.3.17-MariaDB-0+deb10u1 Debian 10 | ||
| - | |||
| - | Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. | ||
| - | |||
| - | Type ' | ||
| - | |||
| - | MariaDB [(none)]> | ||
| - | Query OK, 1 row affected (0.001 sec) | ||
| - | |||
| - | MariaDB [(none)]> | ||
| - | Query OK, 0 rows affected (0.002 sec) | ||
| - | |||
| - | MariaDB [(none)]> | ||
| - | Query OK, 0 rows affected (0.002 sec) | ||
| - | </ | ||
| - | |||
| - | ===== Problèmes rencontrés ===== | ||
| - | ==== " | ||
| - | Il y a un problème de droits sur le dossier / | ||
| - | <code bash> | ||
| - | root@nextcloud:/ | ||
| - | |||
| - | root@nextcloud:/ | ||
| - | total 8 | ||
| - | drwx--x--t 2 www-data www-data 4096 Oct 19 18:32 . | ||
| - | drwxr-xr-x 4 www-data www-data 4096 Oct 19 18:32 .. | ||
| - | </ | ||
| - | |||
| - | Quand on se connecte : | ||
| - | <code bash> | ||
| - | root@nextcloud:/ | ||
| - | total 8 | ||
| - | drwx--x--t 2 www-data www-data 4096 Oct 22 10:00 . | ||
| - | drwxr-xr-x 4 www-data www-data 4096 Oct 19 18:32 .. | ||
| - | -rw------- 1 www-data www-data | ||
| - | </ | ||
nextcloud_dans_lxc.1571738558.txt.gz · Dernière modification : (modification externe)
