Nextcloud on Raspberry Pi3 with nginx

riegerCLOUD: Ziel ist es, nextcloud 9 auf nginx mit PHP 7 und MariaDB auf einem Raspberry Pi3 (Ubuntu 16.04 LTS) zu installieren und durch das EinhÀngen eines Synology-Shares (mount) alle persönlichen Daten stets im Zugriff zu haben.

nextcloud on Raspberry Pi3 with nginx

Viel Spaß, Carsten

Did you by any chance setup a more recent nginx version than the standard 1.6?

hi, my current version is 1.9.15
please have a look at

https://launchpad.net/ubuntu/+source/nginx

cheers, carsten

Hi Carsten,

Thank you for your Guide.
Please write english in this forum :wink: 
or post in the german category.
Otherwise we need to move all your topics :grin:

Thank you! :sunny:

Hallo Carsten,

erstmal Danke fĂŒr die Anleitung!
Genau das was ich gesucht habe, damit ich meinen alten RPi2 & OC 8.0
mit meinem neuen RPi3 & nextlcloud ablösen kann. :slight_smile:

nur leider komme ich irgendwie nicht weiter.

d.h. ich hÀtte vor gehabt:
nextcloud on Raspberry Pi3 with nginx

ich hab die Installation gemacht BEVOR du die letzten beiden Updates gemacht hast.
July 01st, 2016 – removed ‚php7.0-snmp‘ from section <Install PHP 7>
June 30th, 2016 – max upload size

es hat alles geklappt, aber ich komme beim Punkt “Start your browser and call http://yourcloud” :frowning:
und komme einfach nicht mehr weiter.

Hat sonst schon wer erfolgreich die Installation anhand der Anleitung durchgefĂŒhrt?

und was mich auch noch interessieren wĂŒrde:
bis dato habe ich immer selbsterzeugtes SSL Zertifikat erstellt.
bei letsencrypt muss man ja alle 3 Monate das Zerti erneuern/updaten?
hab ich das richtig gelesen?

vielen Dank im Voraus!
dy55

Hallo, was fĂŒr Fehler treten denn auf? Was sagt ggf. das nginx- oder nextcloud log?
LĂ€sst sich der Webserver denn starten und im Browser aufrufen (mit und ohne nextcloud) ? YOURCLOUD ist nur ein Synonym, hast Du es ersetzt durch deinen raspberry servernamen bzw. gem. des servername-Eintrags im nginx-Profil?
Servus, Carsten

Hallo Carsten,

wenn ich die ip Adresse eingebe kommt “404 Not Found” nginx

Ich konnte die nextcloud Installation leider noch gar nicht starten, weil ich beim Browser ja gar nicht zur “nextcloud-Startseite” komme.
Schon klar, dass das yourcloud ein Synonym ist und jederzeit Ă€nderbar, aber wenn ich alles 1:1 so mache, wie du schreibst, dann mĂŒsste es ja mit yourlcoud starten, oder?
normal mĂŒsste ich doch mit http://IP-ADRESSE/deinecloud/ draufkommen, oder?

Carsten, vielen Dank fĂŒr deine Hilfe!
danke
dy55

Moin Moin,

nimm bitte mal die owncloud-Konfig aus dem nginx-Verzeichnis wieder
heraus (rm /etc/nginx/sites-enabled/owncloud)
und aktiviere den default wieder: (ln -s
/etc/nginx/sites-available/defalt /etc/nginx/sites-enabled/default &&
service nginx restart)
Funktioniert der nginx dann? Bzw. was sagt das log von nginx?

Wenn Du es gem. meiner Anleitung machst, dann benötigst Du kein
http://youdcloud/owncloud sondern nur den Namen aus der
Server-Konfiguration bzw. IP.
Sende mir doch sonst mal deine owncloud-nginx-Konfiguration- und die
nginx.conf-Konfigurationsdateien.

Oder ich schalte mich mal per Teamviewer drauf?

GrĂŒĂŸe, Carsten

Hallo Carsten,

danke fĂŒr deine Antwort!
ich komme frĂŒhestens am Mittwoch dazu, dass ich das nochmal genau prĂŒfe.

kannst du mir irgendwie deine Emailadresse zukommen lassen?
gibt es hier sowas wie eine PN?
Teamviewer hört sich natĂŒrlich super an! :slight_smile:

danke & n8
dy55

Per Teamviewer konnten wir das PROB lösen.
Ein Ubuntu Update sorgte fĂŒr Schwierigkeiten
nach wenigen Handgriffen lies sich die nextcloud wunderbar einrichten und konfigurieren.

nginx 1.11.2 with ngx_cache_purge enabled:
link to my blog: nginx 1.11.2

Hi Carsten,

Don’t know why but this line in gateway.conf :

proxy_max_temp_file_size 10240M;

result to this message:

nginx -t
nginx: [emerg] “proxy_max_temp_file_size” directive invalid value in /etc/nginx/conf.d/gateway.conf:47
nginx: configuration file /etc/nginx/nginx.conf test failed

Don’t know if it’s a mistake, i tried also 10G but not better so I used 1024m instead and it works


(i’m using nginx/1.11.4)

Hi Smaig,
what do you use for an architecture, x32 or x64?
E.g. on Raspberry (x32 Bit) you may only use maximum of 2048M or 2G rather than on odroid with much more than 2G (x64 Bit).
If this is not the reason please provide your gateway.conf or compare it with mine: gateway.conf
Cheers, Carsten

Hi Carsten,

Indeed, i’m on raspberry so 32 bit arch. I’ll put 2048m as maximum. Thanks

Edit: I had to go back on 1024m, 2048m result in a directive invalid value as well


Carsten,

I’ve just finished to follow your tutorial and since i’ve configured the gateway part, i’ve no more access to my nextcloud installation.

Here is what i’ve found in the error.log of nginx:

*31 open() “/etc/nginx/html/nexcloud” failed (2: No such file or directory), client: x.x.x.x, server: mydomain.org, request: “GET /nexcloud HTTP/1.1”, host: “mydomain.org”
*31 open() “/etc/nginx/html/favicon.ico” failed (2: No such file or directory), client: x.x.x.x, server: mydomain.org, request: “GET /nexcloud HTTP/1.1”, host: “mydomain.org”

it seems not finding my installation directory
but I used the same as you.

i can also see an redis problem in daemon.log, even with port to 0 in redis.conf:

redis-cli[10719]: Could not connect to Redis at 127.0.0.1:6379: Connection refused
systemd[1]: redis-server.service: control process exited, code=exited status=1
systemd[1]: Unit redis-server.service entered failed state.

Hi SMAIG,
please ensure having changed the redis port from 6379 to 0.
Why is the directory “/etc/nginx/html/nexcloud” mentioned
i do not use this directories.
Did you install nextcloud to /var/www/nextcloud ?
Carsten

Hi Carsten,

yes, I did change the redis port to 0 and redis server is well running on port 0:

redis 11350 0.1 0.2 29408 2504 ? Ssl 14:00 0:00 /usr/bin/redis-server 127.0.0.1:0

and I used the same directory as you /var/www/nextcloud.

root@host:/var/log# ls /var/www/nextcloud/
3rdparty AUTHORS console.php core data index.html l10n occ ocs-provider remote.php robots.txt status.php updater
apps config COPYING-AGPL cron.php db_structure.xml index.php lib ocs public.php resources settings themes version.php

Don’t understand why this directory is mentionned as well


Also i had to add this line in nginx.conf to avoid ‘worker connections exceed’ warning:

worker_rlimit_nofile 65536;

The params in events {} may not be take into account


please provide your nginx.conf, your vHosts (gateway.conf, nextcloud.conf) and also the output of “nginx -V”.
Are your unning nginx 1.11.4?

 i will have a look asap.

yep, using the last 1.11.4 with ngx_cache_purge. Only difference with your installation is that i’m using Raspbian Jessie but except sources, all cli and params are the same.

I did access to the nextcloud installation before moving on the gateway configuration but i didn’t change anything except server hostname of course


Also, i did comment diffie hellman param in nextcloud conf because i didn’t generate it yet (i wanna use 4096 so will do it during the night)

Here are my files:
http://www.megafileupload.com/bP93/nextcloud.conf
http://www.megafileupload.com/bP94/gateway.conf

Thx. i checked your files. You forgot to change the ssl relevant rows:

ssl_certificate /etc/letsencrypt/live/mycloud.dyndns.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mycloud.dyndns.org/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/mycloud.dyndns.org/fullchain.pem;

If i apply the correct directory your config works fine on my test RPI3:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful