OwnCloud v8

shy82

New Member
Hallo Ihr lieben,

hat jemand von euch OwnCloud 7/8 unter ISPConfig mit Nginx und PHP-FPM zum laufen bekommen?

Wenn ich die vhost selber erstelle läuft es. Versuche ich es mittels ISPConfig bekomme ich im Browser immer "Es treten zu viele Weiterleitungen auf".

Falls jemand eine funktionierende "Direktive" zur Hand hat wäre ich Ihm unendlich dankbar diese mit mir zu teilen :)
 
Zuletzt bearbeitet:

shy82

New Member
Ich hab glaub den Übeltäter gefunden....
Und zwar schreibt mir ISPC diese Zeile in die vhost:
Code:
 location ~ \.php$ {
            try_files /c635794574d1b6e2ea33be921ff6951c.htm @php;
        }
Jemand vielleicht ne Ahnung wo der Code her kommt?
 

Till

Administrator
Das ist der normale PHP Handler, der sollte so ok sein.

Aber möglicherweise hast Du versucht in Deinem Custom code den PHP Handler zu überschreiben anstatt nur die notwendigen Rewrite Regeln einzufügen? Was genau hast Du denn ins nginx Direktiven Feld eingefügt?
 

shy82

New Member
Hallo Till,
danke dir schon mal für deine Hilfe.
Code:
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;

index index.php;
error_page 403 = /core/templates/403.php;
error_page 404 = /core/templates/404.php;

        location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
        deny all;
        }

        location / {
                rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
                rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

                rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
                rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;

                rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;

                try_files $uri $uri/ index.php;
         }



       location ~ (.+?\.php)(/.*)?$
                try_files $1 = 404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass 127.0.0.1:9003;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_buffers 64 4K;
       }
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
access_log off;
        }
 

Till

Administrator
was entfernt werden muss ist das hier:

location ~ (.+?\.php)(/.*)?$
try_files $1 = 404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9003;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffers 64 4K;
}

denn damit versuchst Du etwas zu konfigurieren was bereits durch ispconfig konfiguriert ist.
 

shy82

New Member
Nachdem ich den Block entfernt habe bekomme ich im Browser leider noch noch ein die Seite kann nicht geöffnet werden, die vhost schaut jetzt so aus:
Code:
server {
        listen *:80;

        listen *:443 ssl;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_certificate /var/www/clients/client5/web27/ssl/xxx.de.crt;
        ssl_certificate_key /var/www/clients/client5/web27/ssl/xxx.key;

        server_name xxx.de ;

        root   /var/www/xxx.de/web;



        index index.html index.htm index.php index.cgi index.pl index.xhtml;



        error_log /var/log/ispconfig/httpd/xxx.de/error.log;
        access_log /var/log/ispconfig/httpd/xxx.de/access.log combined;

        location ~ /\. {
            deny all;
            access_log off;
            log_not_found off;
        }

        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }

        location /stats/ {

            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/client5/web27/web/stats/.htpasswd_stats;
        }

        location ^~ /awstats-icon {
            alias /usr/share/awstats/icon;
        }

        location ~ \.php$ {
            try_files /ccbf1b4f127462d543cdf6e43ca82d10.htm @php;
        }

        location @php {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9036;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_intercept_errors on;
        }




        rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
        rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
        rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;

        index index.php;
        error_page 403 = /core/templates/403.php;
        error_page 404 = /core/templates/404.php;

        location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
                deny all;
        }

        location / {
                        rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
                        rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;

                        rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
                        rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;

                        rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;

                        try_files $uri $uri/ index.php;
        }




        location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
        expires 30d;
        access_log off;
        }


}

Error Logs sind leer....
 

shy82

New Member
Je nach Browser auch "Kann keine Verbindung zum Server aufbauen"
Ich kann in der Konfiguration nicht mal die info.php aufrufen.
 

shy82

New Member
Ah noch eine Info, ohne diese Anweisung scheint PHP-FPM nicht mehr auf die Seite zu reagieren. Web27 ist jetzt nicht mehr im log vertreten:
Code:
[24-Mar-2015 22:06:02] NOTICE: reloading: execvp("/opt/php-5.6.6/sbin/php-fpm", {"/opt/php-5.6.6/sbin/php-fpm", "--fpm-config", "/opt/php-5.6.6/etc/php-fpm.conf"})
[24-Mar-2015 22:06:02] NOTICE: using inherited socket fd=8, "127.0.0.1:9004"
[24-Mar-2015 22:06:02] NOTICE: using inherited socket fd=8, "127.0.0.1:9004"
[24-Mar-2015 22:06:02] NOTICE: using inherited socket fd=9, "/var/lib/php5-fpm/web14.sock"
[24-Mar-2015 22:06:02] NOTICE: using inherited socket fd=9, "/var/lib/php5-fpm/web14.sock"
[24-Mar-2015 22:06:02] NOTICE: using inherited socket fd=10, "/var/lib/php5-fpm/web16.sock"
[24-Mar-2015 22:06:02] NOTICE: using inherited socket fd=10, "/var/lib/php5-fpm/web16.sock"
[24-Mar-2015 22:06:02] NOTICE: using inherited socket fd=12, "/var/lib/php5-fpm/web7.sock"
[24-Mar-2015 22:06:02] NOTICE: using inherited socket fd=12, "/var/lib/php5-fpm/web7.sock"
[24-Mar-2015 22:06:02] NOTICE: fpm is running, pid 1690
[24-Mar-2015 22:06:02] NOTICE: ready to handle connections
 
tja, ich habe genau das gleiche Problem.
im Forum stand mal, dass die @location... einfach auskommentiert werden müsste (glaube ich).
Aber schlussendlich bin ich wieder zu apache2 gewechselt. --> schade
 

F4RR3LL

Active Member
Also unter nginx läuft owncloud auch mit ispconfig völlig geschmeidig.
bei Optionen nginx Direktiven folgendes hinzufügen:
Code:
  location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
    deny all;
  }
  location / {
    rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
    rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
    rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
    rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
    rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
    try_files $uri $uri/ index.php;
  }
  location ~ ^(.+?\.php)(/.*)?$ {
    try_files $1 = 404;
    include fastcgi_params;
    fastcgi_param PATH_INFO $2;
    fastcgi_param HTTPS on;
    fastcgi_pass unix:/var/lib/php5-fpm/web8.sock;
  }
    location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
    expires 30d;
    access_log off;
  }
bei individuelle php.ini Einstellungen
Code:
post_max_size = 200M;
upload_max_filesize = 200M;
client_max_body_size = 200M;

Anschließend noch kurz nen paar Kleinigkeiten im vhost unter /etc/nginx/sites-enabled/100-eurecloud.vhost anpassen. (favicon und robots.txt muss man natürlich nicht auskommentieren, das mache ich halt so)

Code:
root@host /etc/nginx/sites-enabled # cat 100-eurecloud.vhost

server {
        listen *:80;
        listen *:443 ssl;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_certificate /var/www/clients/balbla euer zeug
        ssl_certificate_key /var/www/clients/blabla euer zeug
        server_name domain ;
        root   /var/www/domain/web;
#       index index.html index.htm index.php index.cgi index.pl index.xhtml;
        error_page 400 /error/400.html;
        error_page 401 /error/401.html;
        error_page 403 /error/403.html;
        error_page 404 /error/404.html;
        error_page 405 /error/405.html;
        error_page 500 /error/500.html;
        error_page 502 /error/502.html;
        error_page 503 /error/503.html;
        recursive_error_pages on;
        location = /error/400.html {
            internal;
        }
        location = /error/401.html {
            internal;
        }
        location = /error/403.html {
            internal;
        }
        location = /error/404.html {
            internal;
        }
        location = /error/405.html {
            internal;
        }
        location = /error/500.html {
            internal;
        }
        location = /error/502.html {
            internal;
        }
        location = /error/503.html {
            internal;
        }
        error_log /var/log/ispconfig/httpd/domain/error.log;
        access_log /var/log/ispconfig/httpd/domain/access.log combined;
#       location ~ /\. {
#          deny all;
#           access_log off;
#           log_not_found off;
#       }
#       location = /favicon.ico {
#           log_not_found off;
#           access_log off;
#       }
#       location = /robots.txt {
#           allow all;
#           log_not_found off;
#           access_log off;
#       }
        location /stats/ {
            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/ceuerclient/euerweb/web/stats/.htpasswd_stats;
        }
        location ^~ /awstats-icon {
            alias /usr/share/awstats/icon;
        }
#       location ~ \.php$ {
#           try_files /b97d745c6b48599b1ac6a0c7717ed270.htm @php;
#       }
        location @php {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/var/lib/php5-fpm/euerweb.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_intercept_errors on;
        }
        client_max_body_size 200M; # set max upload size
        fastcgi_buffers 64 4K;
        rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
        rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
        rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
        index index.php;
  #      error_page 403 /core/templates/403.php;
  #      error_page 404 /core/templates/404.php;
        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }
        location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
            deny all;
        }
        location / {
            rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
            rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
            rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
            rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
            rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
            try_files $uri $uri/ index.php;
        }
        location ~ ^(.+?\.php)(/.*)?$ {
            try_files $1 = 404;
            include fastcgi_params;
            fastcgi_param PATH_INFO $2;
            fastcgi_param HTTPS on;
            fastcgi_pass unix:/var/lib/php5-fpm/euerweb.sock;
        }
        location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
            expires 30d;
            access_log off;
        }
}

Und dann rennt die cloud unter nginx wie ne 1 ;)

Gruß Sven
 
Zuletzt bearbeitet:

nowayback

Well-Known Member
ich würde die error pages komplett rausnehmen und client_max_body_size 10G; funktioniert zwar aber max_upload_size in php.ini muss < 2G sein, daher macht hier ein größerer wert auch keinen sinn
 

F4RR3LL

Active Member
jo da geb ich dir recht. Wollte auch nur mal schnell die passenden Configs posten damit man sieht. Et tut. Bei mir am Server kommen max Dateigrößen von 30 MB an.
Aber ich passe obiges mal an, damits für copy n paster sauber wird.

Gruß Sven

Edit: Done
Bezgl Error Pages, das kann man ja im ISPConf dann einstellen, hierzu muss nicht auf der Console gefummelt werden.
 
Zuletzt bearbeitet:

Werbung

Top