[kein Docker!] Nextcloud - Installation mit Ansible - Playbooks nach Reiner_Nippes

aus anderem Thread:

musst du ja auch nicht. lÀuft auch so. :wink:

# prepare your os and install ansible
curl -s https://raw.githubusercontent.com/ReinerNippes/nextcloud/nextcloud-reloaded/prepare_system.sh | /bin/bash

# clone this repo
git clone --branch nextcloud-reloaded https://github.com/ReinerNippes/nextcloud

# change to nextcloud directory
cd nextcloud

# edit variables
vim inventory

# run the playbook
./nextcloud.yml

Naja, ganz so easy ist es dann doch nicht.

Was sind die Grundvoraussetzungen damt es es ĂŒberhaupt losgehen kann?
Mir genĂŒgt vorerst IPv4.

Bei mir:
vServer im Zugriff, Debian 10.5 (default) ist installiert, IPv4 und Subdomain ist vorhanden.
Was fehlt mich noch?

Da wĂŒrde ich jetzt weitermachen:

htt ps://github.com/ReinerNippes/nextcloud/tree/nextcloud-reloaded

Kann man IPv6 spÀter eintragen?

Das

 Your Nextcloud Server Domain Name

# Default is the fqdn of the Machine
nextcloud_fqdn          = nextcloud.toplevel.domain

geÀndert in

Your Nextcloud Server Domain Name

> 
> # Default is the fqdn of the Machine
> nextcloud_fqdn          = nextcloud.nc-kay.de

Mehr wollte ich nicht Àndern und es funktioniert dann?

Kann man IPv6 spÀter eintragen?

Man kann jedes Linux System und seine Programme mit jedem beliebigen Editor administrieren.

1 Like

@u_n_glaublich
Du hattest mich ein bischen vewirrt.

@Reiner_Nippes

Ich muss nur eine Domain / Subdomain eingeben?

Wird auch fail2ban und Àhnliches installiert?
C-Rieger hat da schöne Anleitungen.

Nach der Anleitung bin ich vorgegangen:

h ttps://github.com/ReinerNippes/nextcloud/tree/nextcloud-reloaded

Fehlermeldung im Browser aufgerufen:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Hallo, wie löse ich das Problem?

Wo finde ich die richtige server log.?

Mein System ist ein Debian 10.5.
Alle Einstellungen default von Reiner_Nippes, nur die Domain wurde angepaßt.

du musst die fqdn eingeben, unter der nextcloud zu erreichen sein soll.

subdomain geht nicht.

Ich habe nur eine kostenfreie Subdomain, dann ist jetzt Schluss?
Kann man das Problem durch kleinere Anpassungen beheben?

Aus dem “inventory file”

nextcloud_fqdn = nextcloud.toplevel.domain

Das ist doch eine Subdomain.

Die gewĂŒnschte Subdomain kann man nicht selber festlegen, “nextcloud.nc-kay.de” ist fest?

cloud.nc-kay.de usw. ist nicht möglich?

sorry. mein fehler. was nicht geht, wĂ€ren subfolder: “nextcloud.toplevel.domain/subfolder”

Wie löse ich mein Problem?

eine testinstallation auf einer aws ec2 mit debian-10-amd64-20200803-347 (ami-05c0d7f3fffb419c8) hat gerade zu folgendem output meines playbooks gefĂŒhrt:

TASK [check install status] ************************************************************************************************************************************************************************************************************************************************************************************************************************
Saturday 22 August 2020  13:36:15 +0000 (0:00:00.569)       0:05:28.707 ******* 
ok: [localhost]

TASK [We are ready] ********************************************************************************************************************************************************************************************************************************************************************************************************************************
Saturday 22 August 2020  13:36:16 +0000 (0:00:00.927)       0:05:29.635 ******* 
ok: [localhost] => changed=false 
  msg:
  - Your Nextcloud 19.0.1.1 at https://**** is ready.
  - 'Login with user: admin and password: L4eHUcLKTkLPCsjC6U9Dsc1M5lNv4aDx '
  - 'Other secrets you''ll find in the directory ~/.nextcloud '

PLAY RECAP *****************************************************************************************************************************************************************************************************************************************************************************************************************************************
localhost                  : ok=110  changed=66   unreachable=0    failed=0    skipped=60   rescued=0    ignored=0   

Saturday 22 August 2020  13:36:16 +0000 (0:00:00.023)       0:05:29.659 ******* 
=============================================================================== 
first setup nextcloud ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 52.14s
install nextcloud -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 36.30s
nextcloud : install additional packages ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 34.45s
apt install postgresql-11 with update ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 32.31s
install needed php packages ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 28.57s
set nextcloud domain config.php values ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 17.22s
php : apt dist-upgrade ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9.69s
tls-certificate : get certificates ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 9.26s
download nextcloud archive ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 9.23s
nextcloud : backup jobs, upgrade apps and database tuning ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 7.67s
os : install additional packages ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 5.44s
install fail2ban packages ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5.27s
os : reload ufw ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.17s
os : install ufw ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 4.13s
redis : install additional packages --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.79s
webserver : install additional packages ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 3.40s
postgres : ensure all configured locales are present. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.89s
nextcloud : install apps -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.79s
webserver : add additional nginx repo ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.77s
add postgres repo key ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.68s

der schritt TASK [check install status] ist ein installationsprĂŒfungsschritt. ok: [localhost] bedeutet, dass unter der adresse url: https://{{ nextcloud_fqdn }}/status.php ein webserver korrekt antwortet. dann bekommst du die oben angezeigt glĂŒckwunschmeldung angezeigt. und kannst dich als admin mit dem password anmelden.

wenn nicht, steht da: "Upss. Something went wrong."

was stand denn bei dir auf dem bildschirm?

→ wir schauen mal in /var/log/nginx/nextcloud.error.log oder so Ă€hnlich. das hĂ€ngt von der nginx config ab.

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

[quote=“Reiner_Nippes, post:30, topic:90101”]
/var/log/nginx/nextcloud.error.log

Die Ausgabe habe ich wieder gelöscht, ich hatte die IPv6 Adresse gepostet.

dort war zu ersehen, dass php-fpm nicht mehr lief.
also: systemctl status php7.4-fpm.service

 systemctl status php7.4-fpm.service
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-08-22 14:24:19 CEST; 2h 3min ago
     Docs: man:php-fpm7.4(8)
  Process: 733 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
 Main PID: 450 (php-fpm7.4)
   Status: "Processes active: 0, idle: 20, Requests: 17, slow: 0, Traffic: 0req/sec"
    Tasks: 21 (limit: 1056)
   Memory: 116.9M
   CGroup: /system.slice/php7.4-fpm.service
           ├─450 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
           ├─713 php-fpm: pool www
           ├─714 php-fpm: pool www
           ├─715 php-fpm: pool www
           ├─716 php-fpm: pool www
           ├─717 php-fpm: pool www
           ├─718 php-fpm: pool www
           ├─719 php-fpm: pool www
           ├─720 php-fpm: pool www
           ├─721 php-fpm: pool www
           ├─722 php-fpm: pool www
           ├─723 php-fpm: pool www
           ├─724 php-fpm: pool www
           ├─725 php-fpm: pool www
           ├─726 php-fpm: pool www
           ├─727 php-fpm: pool www
           ├─728 php-fpm: pool www
           ├─729 php-fpm: pool www
           ├─730 php-fpm: pool www
           ├─731 php-fpm: pool www
           └─732 php-fpm: pool www

Aug 22 14:24:08 debian10 systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...

aus den ersten beiden zeilen des gelöschten logs konnte man schließen, dass gegen 14:16 die sache noch lief.

in den letzten drei zeilen stand, dass sich der nginx nicht mehr mit dem php7.4-fpm socket verbinden konnte.

nach der ausgabe lÀuft php-fpm. wurde aber um 14:24 gestartet.

was passierte zwischen 14:16 und 14:24?

und hast mal ein schlichtes reboot probiert?

ich mache einen reboot

nach dem Reboot:

systemctl status php7.4-fpm.service
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-08-22 16:40:05 CEST; 1min 20s ago
     Docs: man:php-fpm7.4(8)
  Process: 687 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
 Main PID: 452 (php-fpm7.4)
   Status: "Processes active: 0, idle: 20, Requests: 0, slow: 0, Traffic: 0req/sec"
    Tasks: 21 (limit: 1056)
   Memory: 88.0M
   CGroup: /system.slice/php7.4-fpm.service
           ├─452 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
           ├─667 php-fpm: pool www
           ├─668 php-fpm: pool www
           ├─669 php-fpm: pool www
           ├─670 php-fpm: pool www
           ├─671 php-fpm: pool www
           ├─672 php-fpm: pool www
           ├─673 php-fpm: pool www
           ├─674 php-fpm: pool www
           ├─675 php-fpm: pool www
           ├─676 php-fpm: pool www
           ├─677 php-fpm: pool www
           ├─678 php-fpm: pool www
           ├─679 php-fpm: pool www
           ├─680 php-fpm: pool www
           ├─681 php-fpm: pool www
           ├─682 php-fpm: pool www
           ├─683 php-fpm: pool www
           ├─684 php-fpm: pool www
           ├─685 php-fpm: pool www
           └─686 php-fpm: pool www

Aug 22 16:39:54 debian10 systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Aug 22 16:40:05 debian10 systemd[1]: Started The PHP 7.4 FastCGI Process Manager.

im Browser Webadresse aufgerufen:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Welche Protokolle / Ports mĂŒssen in der Firewall zwingend freigeschaltet sein?

dein web server spricht doch mit dir. Internal Server Error kommt von ihm.

wir kommen zurĂŒck zum inhalt von /var/log/nginx/ oder /var/log/php7.4-fpm.log

cat /var/log/php7.4-fpm.log
[22-Aug-2020 14:13:00] NOTICE: fpm is running, pid 42714
[22-Aug-2020 14:13:00] NOTICE: ready to handle connections
[22-Aug-2020 14:13:00] NOTICE: systemd monitor interval set to 10000ms
[22-Aug-2020 14:13:04] NOTICE: Terminating ...
[22-Aug-2020 14:13:04] NOTICE: exiting, bye-bye!
[22-Aug-2020 14:13:04] NOTICE: fpm is running, pid 43438
[22-Aug-2020 14:13:04] NOTICE: ready to handle connections
[22-Aug-2020 14:13:04] NOTICE: systemd monitor interval set to 10000ms
[22-Aug-2020 14:13:10] NOTICE: Terminating ...
[22-Aug-2020 14:13:10] NOTICE: exiting, bye-bye!
[22-Aug-2020 14:13:10] NOTICE: fpm is running, pid 43781
[22-Aug-2020 14:13:10] NOTICE: ready to handle connections
[22-Aug-2020 14:13:10] NOTICE: systemd monitor interval set to 10000ms
[22-Aug-2020 14:23:34] NOTICE: Terminating ...
[22-Aug-2020 14:23:34] NOTICE: exiting, bye-bye!
[22-Aug-2020 14:24:17] NOTICE: fpm is running, pid 450
[22-Aug-2020 14:24:17] NOTICE: ready to handle connections
[22-Aug-2020 14:24:17] NOTICE: systemd monitor interval set to 10000ms
[22-Aug-2020 16:39:22] NOTICE: Terminating ...
[22-Aug-2020 16:39:22] NOTICE: exiting, bye-bye!
[22-Aug-2020 16:40:03] NOTICE: fpm is running, pid 452
[22-Aug-2020 16:40:03] NOTICE: ready to handle connections
[22-Aug-2020 16:40:03] NOTICE: systemd monitor interval set to 10000ms

Ganz so trivial erscheint “Nextcloud mit Ansible-Playbooks-nach-Reiner-Nippes” nicht.

Wie bekomme ich das Problem gelöst?

Mein DSL Anschluss hat Dual Stack IPv4 / IPv6
Mein vServer hat eine IPv4 und eine IPv6 Adresse.

Welche Protokolle / Ports mĂŒssen in der Firewall zwingend freigeschaltet sein?

Dazu gibt es jede menge Dokumentationen in Internet. Kleiner Warnhinweis. Wenn du falsche angaben machst bei der Firewall (UFW) sperrst du dich wohl möglich aus.
Das gleiche kann dir auch bei Fail2ban passieren.

Und wegen dein. [Internal Server Error]
Wenn du noch zugriff hast geh mal in de NC config
und Àndere kurzfristig die zwei zeilen in
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.locking’ => ‘\OC\Memcache\APCu’,

Und lade die seite neu.

Kann sein das es daran liegt.

Guten Abend,

ich bin gerade am Versuch von nextcloudpi mich abzukapseln und möchte meine Nextcloud in einer Testweise mit deinem Script erstellen.

Leider möchte ich das auf der Synology DS920+ in Docker installieren, leider kann ich hier dein curl -s https://raw.githubusercontent.com/reinernippes/nextcloud_on_docker/master/prepare_system.sh | /bin/bash nicht runterladen da es auf der Synology nicht unterstĂŒtzt wird.

Gibt es hier eine Möglichkeit es trotzdem zu installieren?

das wĂ€re - glaube ich - auch keine gute idee. das playbook ist dafĂŒr geschrieben auf einer möglichst “nackten” linux installation einen kompletten stack fĂŒr nextcloud zu installieren. in dem fall inklusive docker. auf deiner synology ist aber vieles schon installiert und vieleicht anderes. (andere pfade, usw.) im schlimmsten fall geht danach nix mehr. wĂŒrde ich nicht testen wollen.

was man vielleicht machen könnte:

gibt es bei der synology die möglichkeit sich remote bei dem docker daemon anzumelden? dann könnte man vielleicht bei den docker_container: tasks den parameter docker_host hinzufĂŒgen. aber man mĂŒsste alle os related tasks ausbauen.

lange rede/kurzer sinn.

nicht ohne neuschreiben.

schon mal portainer als docker frontend gesehen?