Ergebnis 1 bis 10 von 14

Baum-Darstellung

  1. #6
    Emo Pwny Avatar von J0hn.X3r
    Registriert seit
    03.06.2007
    Beiträge
    3.256

    Standard AW: Aufsezen von Nextcloud - Umleitungsfehler

    Ahoi,

    beim PHP Header brauchst du nichts anpassen, sondern beim Handler Welche Linux Distri nutzt du?

    An sich ist die Installation eigentlich recht einfach.

    Du laedst die aktuelle Version runter, ueberpruefst wenn du Lust und Zeit hast, ob die Checksummen uebereinstimmen.

    Entpackst das ganze und machst am besten ein:

    Code:
    cp -r nextcloud /var/www
    Damit wird der entpackte Ordner ins webverzeichnis /var/www kopiert. Nutzt dann am besten folgendes Permissionsscript:

    Code:
    #!/bin/bash
    ncpath='/var/www/nextcloud'
    htuser='www-data'
    htgroup='www-data'
    rootuser='root'
    
    printf "Creating possible missing Directories\n"
    mkdir -p $ncpath/data
    mkdir -p $ncpath/assets
    mkdir -p $ncpath/updater
    
    printf "chmod Files and Directories\n"
    find ${ncpath}/ -type f -print0 | xargs -0 chmod 0640
    find ${ncpath}/ -type d -print0 | xargs -0 chmod 0750
    
    printf "chown Directories\n"
    chown -R ${rootuser}:${htgroup} ${ncpath}
    chown -R ${htuser}:${htgroup} ${ncpath}/apps/
    chown -R ${htuser}:${htgroup} ${ncpath}/assets/
    chown -R ${htuser}:${htgroup} ${ncpath}/config/
    chown -R ${htuser}:${htgroup} ${ncpath}/data/
    chown -R ${htuser}:${htgroup} ${ncpath}/themes/
    chown -R ${htuser}:${htgroup} ${ncpath}/updater/
    
    chmod +x ${ncpath}/occ
    
    printf "chmod/chown .htaccess\n"
    if [ -f ${ncpath}/.htaccess ]
     then
      chmod 0644 ${ncpath}/.htaccess
      chown ${rootuser}:${htgroup} ${ncpath}/.htaccess
    fi
    if [ -f ${ncpath}/data/.htaccess ]
     then
      chmod 0644 ${ncpath}/data/.htaccess
      chown ${rootuser}:${htgroup} ${ncpath}/data/.htaccess
    fi
    Passt ggf. Verzeichnis oder Webserver user und gruppe an, sollte bei Debian zum Beispiel aber so passen.

    Dann schaust du dir die beispiel nginx config an:

    Code:
    upstream php-handler {
        server 127.0.0.1:9000;
        #server unix:/var/run/php5-fpm.sock;
    }
    
    server {
        listen 80;
        server_name cloud.example.com;
        # enforce https
        return 301 https://$server_name$request_uri;
    }
    
    server {
        listen 443 ssl;
        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-Frame-Options "SAMEORIGIN";
        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;
    
        # Disable gzip to avoid the removal of the ETag header
        gzip off;
    
        # 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/.+|core/templates/40[34])\.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=7200";
            # 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-Frame-Options "SAMEORIGIN";
            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;
        }
    }
    Ich empfehle die Nutzung von php-fpm, der obere Bereich aendert sich also zu:

    Code:
    upstream php-handler {
        #server 127.0.0.1:9000;
        server unix:/var/run/php5-fpm.sock;
    }
    Wenn du PHP 7 oder 7.1 nutzt (das empfehle ich), dann muesste das entsprechend auf "unix:/var/run/php/php7.1-fpm.sock;" abgeaendert werden.

    Wenn du ein SSL Zertifikat hast (zum Beispiel von lets encrypt) dann ist das gut, dann koennteste direkt die Keys in der Config anpassen bzw. reinsetzen - wenn (noch) nicht, muesstest du die Weiterleitung (also den ersten server-Block) auskommentieren und "listen 80;" ueber dem "listen 443;" im zweiten Server-Block hinzufuegen (oder gleich 80 statt 443 reinschreiben) und zusaetzlich das "listen 443" und die "ssl_cert" zeilen auskommentieren. server_name anpassen nicht vergessen.

    Eigentlich sollte dann alles soweit klappen - wenn nicht, werden dir fehlende php-module aufgelistet die du eben noch nachinstallieren muesstest.

    Wenn noch Fragen offen sind.. gerne

    Boardregeln * Blackmarket * SuFu * Kontakt * PGP Key

    ..das Handy klingelt, sie fragen nach Kollegah
    dem morgens schon Giorgi-Armani-Sakkoträger
    heben Bares ab und zahlen, nehmen die Ware ab und gehen
    es ist der Strassenapotheker


  2. Folgende Benutzer haben sich für diesen Beitrag bedankt:

    s3rb31 (19.05.2017)

Ähnliche Themen

  1. [H]vSerber aufsetzen
    Von Bart2oo im Forum Hosting
    Antworten: 17
    Letzter Beitrag: 22.10.2010, 18:10
  2. Webserver/FTP auf WIN VPS aufsetzen
    Von Mirr0w im Forum Hosting
    Antworten: 3
    Letzter Beitrag: 09.07.2010, 17:46
  3. [S] Tut SSL Server aufsetzen.
    Von BlackCobra im Forum Suche Tutorials
    Antworten: 0
    Letzter Beitrag: 03.03.2010, 15:46
  4. Windows neu aufsetzen
    Von Tariaky im Forum Windows
    Antworten: 2
    Letzter Beitrag: 27.01.2009, 16:56
  5. iPAQ neu aufsetzen
    Von Eisregen666 im Forum Konsolen Modding/Tuning
    Antworten: 0
    Letzter Beitrag: 16.02.2008, 17:28

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •