- Copy internal post link
- Copy external post link
- Report article
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html
[content:369701]
Webserver (Nextcloud) unter Raspian, PHP7 und nginx
ich möchte mir einen kleinen Webserver auf einem RasperryPi einrichten um dann von überall auf diesen Kleinen zugreifen zu können.
Ich habe dazu folgende Anleitung herausgesucht:
Anleitung Nextcloud auf Raspi
Leider hänge ich bei Punkt 4.3, bei dem ich auf folgende weitere Anleitung vom selben Blogbetreiber geleitet werde:
Let's Encrypt Zertifikat
Bei dieser Anleitung hänge ich aktuell beim Punkt wo ich folgende Codezeile im Terminal ausführen möchte:
sudo certbot certonly --rsa-key-size 4096 --webroot -w /var/www/letsencrypt -d eureDomain.de -d www.eureDomain.de
Natürlich ist unter "eureDomain" mein Domänenname eureDomain.ddnss.de eingegeben.
Folgende Fehlermeldung bzw. Ausgabe:
Folgende Einstellungen habe ich bei meinem DynDNS-Anbieter "ddnss" eingestellt:
Ich muss gestehen, dass ich nicht viel Ahnung von Webservern habe, das kleine Projekt aber doch gerne schaffen möchte. Ich hoffe es kann mir jemand zur Seite stehen.
Vielen Dank!
Content-Key: 369701
Url: https://administrator.de/contentid/369701
Printed on: April 24, 2024 at 06:04 o'clock
- Comment overview - Please log in
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274752
[content:369701#1274752]
ist dein Raspi aus dem Internet über Port 80 und 443 erreichbar?
LetsEncrypt prüft beim Erstellen die Gegenstelle darüber und meckert in deinem Screen auch eine fehlende Verbindung zum Client an.
Viele Grüße
T
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274754
[content:369701#1274754]
Ich habe mir die Fehlermeldung auch nochmal genauer angesehen. Ich habe gerade gemerkt, dass der Webserver nichtmal intern über seine IP erreicht werden kann. Dabei habe ich folgendes in die Datei /etc/nginx/sites-available/default kopiert:
upstream php-handler {
server unix:/run/php/php7.0-fpm.sock;
}
server {
listen 80;
server_name cloud.example.com;
# enforce https
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name cloud.example.com;
ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;
# Add headers to serve security related headers
# Before enabling Strict-Transport-Security headers please read into this
# topic first.
# add_header Strict-Transport-Security "max-age=15768000;
# includeSubDomains; preload;";
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
# Path to the root of your installation
root /var/www/html/nextcloud/;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# The following 2 rules are only needed for the user_webfinger app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
# last;
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
# set max upload size
client_max_body_size 512M;
fastcgi_buffers 64 4K;
# Enable gzip but do not remove ETag headers
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
# Uncomment if your server is build with the ngx_pagespeed module
# This module is currently not supported.
#pagespeed off;
location / {
rewrite ^ /index.php$uri;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
#Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass php-handler;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
}
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
try_files $uri/ =404;
index index.php;
}
# Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|js|woff|svg|gif)$ {
try_files $uri /index.php$uri$is_args$args;
add_header Cache-Control "public, max-age=15778463";
# Add headers to serve security related headers (It is intended to
# have those duplicated to the ones above)
# Before enabling Strict-Transport-Security headers please read into
# this topic first.
# add_header Strict-Transport-Security "max-age=15768000;
# includeSubDomains; preload;";
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
try_files $uri /index.php$uri$is_args$args;
# Optional: Don't log access to other assets
access_log off;
}
}
So ist es in der oben angegebenen Beschreibung vorgegeben. Ich denke aber, dass dafür auch der SSL-Zugang schon bestehen muss. Wäre es nicht im ersten Schritt sinnvoller, den Webserver intern verfügbar zu machen? Da ich wirklich blutiger Anfänger bin, wäre meine Frage, was ich in die oben angegebene Datei schreiben muss, sodass ich erst einmal intern Zugriff habe...
Danke!
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274761
[content:369701#1274761]
Hast du Server_name angepasst in deiner oben genannten konfig?
Kann es sein das deine Firewall auf dem PI noch an ist bzw 80 ubd 443 nicht offen sind ?
Ist der Dienst vom nginx gestartet ?
Service nginx Status
Wie sieht deine hosts Datei aus bzw wie ist dein hostname?
Trag mal deine Lokale IP anstatt des servernamens an.
Bitte nicht vergessen den ngnix neu zu starten.
Mit freundlichen Grüßen Nemesis
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274762
[content:369701#1274762]
https://www.heise.de/ct/ausgabe/2018-4-SSL-TLS-Zertifikate-gratis-fuer-a ...
https://www.heise.de/ct/ausgabe/2018-4-acme-sh-bezieht-Wildcard-Zertifik ...
Lokal rennt der nginx aber schon, oder ? Kannst du den über seine lokale IP erreichen ?
Der nginx rennt eigentlich out of the box wenn man den mit apt-get install nginx installiert.
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274791
[content:369701#1274791]
Service nginx Status
Bitte nicht vergessen den ngnix neu zu starten.
In der Februar ct' waren recht gute Artikel zum Thema Lets Encrypt und deren Automatisierung:
https://www.heise.de/ct/ausgabe/2018-4-SSL-TLS-Zertifikate-gratis-fuer-a ...
https://www.heise.de/ct/ausgabe/2018-4-acme-sh-bezieht-Wildcard-Zertifik ...
Das ist halt das Problem, wenn man etwas stur nach Anleitung machen möchte. Wenn das Verständnis fehlt, hörts auf. Hier einmal die Freigabe in meiner FritzBox:
Mich wundert der 64553er Port, obwohl ich beim Erstellen den Port 443 angegeben habe bzw. er automatisch ausgewählt wurde. Dazu muss ich sagen, dass ich noch ein Synology-NAS im Netzwerk habe, auf dem ein Synology-DynDNS Dienst eingerichtet ist. Dort ist also auch schon ein Webserver installiert. Den dort hinterlegten Inhalt erreiche ich auch mit der neuen DDNSS-Adresse. Aber wenn ich diese Synology ausschalte, dann sollte er doch die HTTP und HTTPS Anfragen an meinen Rasperry weiterleiten, oder sehe ich das falsch (Codezeile 9) ?
Hier nochmal der aktuelle Inhalt der Datei /etc/nginx/sites-available/default:
upstream php-handler {
server unix:/run/php/php7.0-fpm.sock;
}
server {
listen 80;
server_name 192.168.2.4;
# enforce https
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name cloud.example.com;
ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;
# Add headers to serve security related headers
# Before enabling Strict-Transport-Security headers please read into this
# topic first.
# add_header Strict-Transport-Security "max-age=15768000;
# includeSubDomains; preload;";
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
# Path to the root of your installation
root /var/www/html/nextcloud/;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# The following 2 rules are only needed for the user_webfinger app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
# last;
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
# set max upload size
client_max_body_size 512M;
fastcgi_buffers 64 4K;
# Enable gzip but do not remove ETag headers
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
# Uncomment if your server is build with the ngx_pagespeed module
# This module is currently not supported.
#pagespeed off;
location / {
rewrite ^ /index.php$uri;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
#Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass php-handler;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
}
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
try_files $uri/ =404;
index index.php;
}
# Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|js|woff|svg|gif)$ {
try_files $uri /index.php$uri$is_args$args;
add_header Cache-Control "public, max-age=15778463";
# Add headers to serve security related headers (It is intended to
# have those duplicated to the ones above)
# Before enabling Strict-Transport-Security headers please read into
# this topic first.
# add_header Strict-Transport-Security "max-age=15768000;
# includeSubDomains; preload;";
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
try_files $uri /index.php$uri$is_args$args;
# Optional: Don't log access to other assets
access_log off;
}
}
Danke für die Hilfe!
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274795
[content:369701#1274795]
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274796
[content:369701#1274796]
Datei info.php mit dem Inhalt:
<?php
phpinfo();
?>
erstellen und über den Browser aufrufen
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274797
[content:369701#1274797]
Dann nur noch PHP scharf schalten...
Datei info.php mit dem Inhalt: <?php
phpinfo();
?>
erstellen und über den Browser aufrufen
Die PHP-Datei habe ich erstellt und ins Verzeichnis meines Webservers gelegt. Wenn ich die Seite intern/extern Aufrufe:
meineDomain.ddnss.de/info.php bekomme ich den ErrorCode 404.
Edit:
Habe den Port in der FritzBox jetzt auf 443 statt 64533. Benötige ich nicht wenigstens ein selbst erstelltes Zertifikat um über HTTPS zugreifen zu können?
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274907
[content:369701#1274907]
Wo genau hast du die phpinfo hingelegt?
Die Seite sollte auch über http und Port 80 erreichbar sein.
Erstmal deinen Webserver lokal ordentlich machen, dann den externen Zugriff.
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274924
[content:369701#1274924]
https://www.howtoforge.de/anleitung/installation-von-nginx-mit-php5-und- ...
Hier die angepasste /etc/nginx/sites-available/default auf einem Raspberry Pi:
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274958
[content:369701#1274958]
Wenn ich jetzt im Browser über http://192.168.2.4 den Webserver aufrufe, dann bekomme ich aber nicht meine selbst erstellte HTML-Seite zurück, sondern nach wie vor die Default-NGINX-index.html. Was mich etwas wundert, da ich diese bereits entfernt habe.
In der /etc/nginx/sites-available/default habe ich folgendes als Root-Verzeichnis stehen:
# Path to the root of your installation
root /var/www/html/;
Ich habe ja oben auch mal den kompletten Inhalt meiner /etc/nginx/sites-available/default gepostet. Da kann man entnehmen, was ich bereits dort eingefügt habe. Aber wie gesagt, eben stur nach Anleitung vorgegangen, weil ich selbst noch wenig Ahnung habe.
Die Änderungen an der nginx Konfig Datei hast du aber gemacht damit nginx überhaupt PHP versteht ?
Hier die angepasste /etc/nginx/sites-available/default auf einem Raspberry Pi:
> # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
> #
> location ~ \.php$ {
> fastcgi_split_path_info ^(.+\.php)(/.+)$;
> # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
> #
> # # With php5-cgi alone:
> # fastcgi_pass 127.0.0.1:9000;
> # # With php5-fpm:
> fastcgi_pass unix:/var/run/php5-fpm.sock;
> fastcgi_index index.php;
> include fastcgi_params;
> }
>
> # deny access to .htaccess files, if Apache's document root
> # concurs with nginx's one
> #
> #location ~ /\.ht {
> # deny all;
> #}
> }
Ich habe meinen Webserver mit PHP7 bestückt, weil ich direkt auf neuere Versionen von Nextcloud updaten können möchte. Ich weiß immer nicht, in wie weit ich diese Anleitung dann auf mein Projekt übernehmen kann.
Vielleicht sollte ich die /etc/nginx/sites-available/default einmal komplett leeren und nur das nötigste rein schreiben. Aber was das ist, weiß ich nicht.
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1274971
[content:369701#1274971]
Deshalb kann nginx deine beiden Test Dateien index.html und info.php nicht finden da die ja in /var/www/html liegen.
Du musst diese also ins Document Root Verzeichnis kopieren. Dann sollte das klappen.
Hast du mit apt-get install php7-cgi php7-fpm die PHP cgi und fpm Pakete installiert ?
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275000
[content:369701#1275000]
Du hast ja deine HTML Document Root auf root /var/www/html/nextcloud/ gelegt.
Deshalb kann nginx deine beiden Test Dateien index.html und info.php nicht finden da die ja in /var/www/html liegen.
Du musst diese also ins Document Root Verzeichnis kopieren. Dann sollte das klappen.
apt-get install php7.0-common php7.0-fpm php7.0-cli php7.0-json php7.0-mysql php7.0-curl php7.0-intl php7.0-mcrypt php-pear php7.0-gd php7.0-zip php7.0-xml php7.0-mbstring
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275008
[content:369701#1275008]
Wo steht denn die Default index.html ?? Die funktioniert doch, oder ?
Genau DA müssen auch die anderen beiden Files auch hin.
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275032
[content:369701#1275032]
Wo steht denn die Default index.html ?? Die funktioniert doch, oder ?
Genau DA müssen auch die anderen beiden Files auch hin.
Mich wundert es auch, da ich in /var/www/html nur zwei Dateien liegen habe. Meine beiden index.html (funktioniert) und info.php (konnte ich noch nicht testen). Es liegt nichts anderes in diesem Ordner und trotzdem wird die Willkommensseite von NGINX angezeigt. Ich finde diese Willkommens-HTML auch nirgends. Das ist sehr seltsam...
Hier nochmal der Bereich des Pfades in der /etc/nginx/sites-available/default:
# Path to the root of your installation
root /var/www/html;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
Dienst-Neustart und kompletter Reboot bringen keine Änderungen. Es kann doch dann nur ein anderes Verzeichnis das Root-Verzeichnis sein oder nicht?
EDIT
Ich habe inzwischen herausgefunden, dass der Webserver anzeigt, was in /usr/share/nginx/html liegt.
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275050
[content:369701#1275050]
Ich hatte das hier auf einem RasPi (Debian) getestet und da rennt alles fehlerfrei wie es soll !
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275084
[content:369701#1275084]
Klingt irgendwie nach einer recht verwarzten HTTP Server Konfig.
Ich hatte das hier auf einem RasPi (Debian) getestet und da rennt alles fehlerfrei wie es soll !
Ich habe nginx einmal komplett deinstalliert:
apt remove --purge nginx nginx-common nginx-full
und dann wieder neu installiert:
apt install nginx
Die default Config-Datei ist nun wieder die Standard von nginx. Allerdings wird nach wie vor der Pfad /usr/share/nginx/html als Webspace aufgerufen, obwohl in der default Config-Datei bereits folgendes steht:
root /var/www/html
Dann greift diese Config-Datei nicht, anders kann ich mir das nicht erklären.
Kann es vielleicht damit zusammenhängen, dass folgendes installiert ist:
Ist das nicht auch ein Webserver? Den habe ich gerade in einer Liste entdeckt. Wurde aber von mir nicht wissentlich installiert.
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275106
[content:369701#1275106]
Das kann dann natürlich nicht klappen, denn beide streiten sich dann um den HTTP Port TCP 80 und 443.
Es sei denn einer von denen nutzt andere Ports.
Den lighttpd solltest du dann natürlich sofort runterschmeissen. Das ist vermutlich genau der Fehler.
Wozu ist der überhaupt installiert ? Eigentlich Unsinn.
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275142
[content:369701#1275142]
Das kann dann natürlich nicht klappen, denn beide streiten sich dann um den HTTP Port TCP 80 und 443.
Es sei denn einer von denen nutzt andere Ports.
Den lighttpd solltest du dann natürlich sofort runterschmeissen. Das ist vermutlich genau der Fehler.
Wozu ist der überhaupt installiert ? Eigentlich Unsinn.
Ich weiß nicht wo der her kommt. Ich habe ihn nicht wissentlich installiert. Er war also entweder bei Rasbian schon vorinstalliert oder er wurde durch ein anderes Paket (nginx, php7.0, mysql) mit installiert. Ich habe jetzt minimal Rasbian installiert und fang nochmal von vorne an.
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275205
[content:369701#1275205]
Aber auch mit einem Debian oder Xubuntu kommt es sofort zum Fliegen.
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275254
[content:369701#1275254]
Damit klappt es sofort ! Siehe oben...
Aber auch mit einem Debian oder Xubuntu kommt es sofort zum Fliegen.
Also jetzt rennt er auch mit Letsencrypt Zertifikat...perfekt!
Bis hierher gilt schon einmal ein recht herzliches Dankeschön!
Wenn ich jetzt PHP7.0 als Paket installieren möchte, dann will er mir z.B. auch apache2 mit installieren. Muss ich hier die Pakete einzeln angeben oder gibt es einen speziellen Befehl?
Ich kenne die minimal benötigten Pakete nicht.
EDIT:
Was ist denn der Unterschied zwischen PHP7.0-fpm und PHP7.0-cgi ?
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275420
[content:369701#1275420]
- Copy internal comment link
- Copy external comment link
- To the beginning of the comments
https://administrator.de/forum/webserver-nextcloud-unter-raspian-php7-und-nginx-369701.html#comment-1275589
[content:369701#1275589]
etc/nginx/sites-available/default -- Inhalt:
upstream php-handler {
server 127.0.0.1:9000;
server unix:/var/run/php5-fpm.sock;
}
server {
listen 80;
listen [::]:80;
server_name cloud.example.com;
# enforce https
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name cloud.example.com;
ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
ssl_certificate_key /etc/ssl/nginx/cloud.example.com.key;
# Add headers to serve security related headers
# Before enabling Strict-Transport-Security headers please read into this
# topic first.
# add_header Strict-Transport-Security "max-age=15768000;
# includeSubDomains; preload;";
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
# Path to the root of your installation
root /var/www/nextcloud/;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# The following 2 rules are only needed for the user_webfinger app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
# last;
location = /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
# set max upload size
client_max_body_size 512M;
fastcgi_buffers 64 4K;
# Enable gzip but do not remove ETag headers
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
# Uncomment if your server is build with the ngx_pagespeed module
# This module is currently not supported.
#pagespeed off;
location / {
rewrite ^ /index.php$uri;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
#Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass php-handler;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
}
location ~ ^/(?:updater|ocs-provider)(?:$|/) {
try_files $uri/ =404;
index index.php;
}
# Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|js|woff|svg|gif)$ {
try_files $uri /index.php$uri$is_args$args;
add_header Cache-Control "public, max-age=15778463";
# Add headers to serve security related headers (It is intended to
# have those duplicated to the ones above)
# Before enabling Strict-Transport-Security headers please read into
# this topic first.
# add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
try_files $uri /index.php$uri$is_args$args;
# Optional: Don't log access to other assets
access_log off;
}
}
Die Zeilen 9, 17, 19, 20 habe ich angepasst. Nun bekomme ich eine "502 Bad Gateway" Fehlermeldung vom Browser zurück. Es ist wirklich zum Haare raufen.
Den angegebenen Inhalt der Default-Datei habe ich aus folgender Seite: klick
Was soll ich noch anders machen? Ich kopiere doch nur
Der einzige Unterschied welcher mir auffällt ist, dass ich keine .cert und .key sonder zweimal .pem Zertifikate habe. Ist das relevant? Mit diesen Zertifikaten ging es vor dem kopieren des Quelltextes ja mit HTTPS auf den Webserver zuzugreifen.
Ich hoffe ihr könnt mich auch hier in die richtige Richtung schupsen...