ISPconfig 3 and ownCloud (nginx, ceontOS 6.5) on VPS

Discussion in 'ISPConfig 3 Priority Support' started by inside83, Jan 19, 2015.

  1. inside83

    inside83 Member

    Hello!
    I upgraded my ownCloud server to 8.1.1 and on the admin page it shows these errors:
    1.png
    I'm running ISPconfig 3.0.5.4p8 on CentOS 6 with nginx.
    Please help.
    Are there nginx directives for ownCloud 8.1.1?
     
    Last edited: Sep 14, 2015
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    As far as I can see, none of this messages are related to nginx directives, so the ones that you use should be fine. is owncloud working when you close this message?
     
  3. inside83

    inside83 Member

    Yes, own cloud is working fine but it's very, very slow.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to install a memory cache like xcache or apc. Ob Debain and Ubuntu, xcache can be installed with the command:

    apt-get install php5-xcache
     
  5. inside83

    inside83 Member

    I'm sorry
    This is my only server running CentOS so I just routinely put "Debian" but in fact this ownCloud server is on CentOS.
    It's still nginx and ISPconfig version 3.0.5.4p8
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to search for xcache or apc package with yum.
     
  7. inside83

    inside83 Member

  8. till

    till Super Moderator Staff Member ISPConfig Developer

    PHP is configured in fpm mode by ispconfig, so none of the two configs are nescessary on your ispconfig server as thats already cnfigured.

    All you need on a ispconfig server is this (copy it into the nginx directives field:

    Code:
    rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
    rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
    rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
    rewrite ^/apps/calendar/caldav.php /remote.php/caldav/ last;
    rewrite ^/apps/contacts/carddav.php /remote.php/carddav/ last;
    rewrite ^/apps/([^/]*)/(.*\.(css|php))$ /index.php?app=$1&getfile=$2 last;
    rewrite ^/remote/(.*) /remote.php last;
    
    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$is_args$args;
    }
    
    location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
    expires 30d;
    access_log off;
    }
    
     
  9. inside83

    inside83 Member

    I did that and nginx keeps restarting (I'm getting e-mail from monit) adn when I login to ownCloud, nothing is clickable, it says "No files here" and "The files you are trying to load exceed the maximum size for this server"
    :(
     
  10. inside83

    inside83 Member

    I had this in nginx directives:
    Code:
    location ~ \.php$ {
                fastcgi_read_timeout 600s;
                fastcgi_send_timeout 600s;
                try_files /b615814d8f2c19dbcb25b1fbae07ce38.htm @php2;
            }
    
            client_max_body_size 10G; # set max upload size
    
            rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
            rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
            rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
            rewrite ^/apps/calendar/caldav.php /remote.php/caldav/ last;
            rewrite ^/apps/contacts/carddav.php /remote.php/carddav/ last;
            rewrite ^/remote/(.*) /remote.php last;
    
            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$is_args$args;
            }
    
            location ~ ^(.+?\.php)(/.*)?$ {
                            try_files $1 =404;
    
                            include fastcgi_params;
                            fastcgi_param SCRIPT_FILENAME $document_root$1;
                            fastcgi_param PATH_INFO $2;
                            fastcgi_param HTTPS $https;
                            {FASTCGIPASS}
                            fastcgi_intercept_errors on;
                            fastcgi_index index.php;
                            fastcgi_buffers 64 4K;
                            fastcgi_read_timeout 600s;
                            fastcgi_send_timeout 600s;
            }
    
            location @php2 {
                            fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
                            include fastcgi_params;
                            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                            fastcgi_param PATH_INFO $fastcgi_path_info;
                            fastcgi_param HTTPS $https;
                            {FASTCGIPASS}
                            fastcgi_intercept_errors on;
                            fastcgi_index index.php;
                            fastcgi_buffers 64 4K;
                            fastcgi_read_timeout 600s;
                            fastcgi_send_timeout 600s;
            }
    
            location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
                            expires 30d;
                            access_log off;
            }
    location /munin {
                           alias /var/cache/munin/www;
                           auth_basic "Restricted";
    auth_basic_user_file /var/cache/munin/.htpasswd;
                           location ~* ^/munin/(.+\.(jpg|jpeg|gif|css|png|js|ico|xml|txt))$ {
                                    alias /var/cache/munin/www/$1;
                           }
                    }
     
  11. inside83

    inside83 Member

  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Is this the exact error message? Did you check the error.log of the site as well?
     
  13. inside83

    inside83 Member

    No, it's not.
    I changed the language to Croatian so this is the translation. I'll change it to English and than post it again.
    The last line of the error.log of the site is:
    Code:
    2015/09/30 19:32:40 [error] 21157#0: *684 open() "/var/www/my_own_cloud_url/web/index.php/core/js/oc.js" failed (20: Not a directory), client: my_IP_address, server: my_own_cloud_url, request: "GET /index.php/core/js/oc.js?v=e7d5dfb794fb53ce66e1057a165ffbbd&_=1443634355799 HTTP/1.1", host: "my_own_cloud_url", referrer: "https://my_own_cloud_url/index.php/apps/files/"
     
  14. inside83

    inside83 Member

    This is the screenshot.
    2015-09-30 19_51_36-Files - ownCloud.png
     
  15. inside83

    inside83 Member

    @till
    Is there a solution?
     
  16. itsolon

    itsolon Member

    for Owncloud 10.0.7 on nginx and ISPConfig 3.11 i have following working pretty good.
    all i can not understand is:
    this line inside:
    try_files /b615814d8f2c19dbcb25b1fbae07ce38.htm @php2;

    Code:
     
          add_header Strict-Transport-Security "max-age=15552000; includeSubDomains";
          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;
     
          location = /robots.txt {
              allow all;
              log_not_found off;
              access_log off;
          }
     
    
          location ~ \.php$ {
            try_files /b615814d8f2c19dbcb25b1fbae07ce38.htm @php2;
          }
    
     
          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 1G;
          fastcgi_buffers 16 4K;
          fastcgi_ignore_headers X-Accel-Buffering;
    
          gzip off;
       
          error_page 403 /core/templates/403.php;
          error_page 404 /core/templates/404.php;
     
          location / {
              rewrite ^ /index.php$uri;
          }
     
          location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
              return 404;
          }
          location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
              return 404;
          }
    
        location ~ ^(.+?\.php)(/.*)?$ {
                            try_files $1 =404;
                            include fastcgi_params;
                            fastcgi_param SCRIPT_FILENAME $document_root$1;
                            fastcgi_param PATH_INFO $2;
                            fastcgi_param HTTPS $https;
                            {FASTCGIPASS}
                            fastcgi_intercept_errors on;
                            fastcgi_index index.php;
                            fastcgi_buffers 64 64K;
                            fastcgi_buffer_size 256k;
                            fastcgi_param modHeadersAvailable true;
                            fastcgi_read_timeout 7200;
            }
    
        location @php2 {
                            fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
                            include fastcgi_params;
                            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                            fastcgi_param PATH_INFO $fastcgi_path_info;
                            fastcgi_param HTTPS $https;
                            {FASTCGIPASS}
                            fastcgi_intercept_errors on;
                            fastcgi_index index.php;
                            fastcgi_buffers 64 64K;
                            fastcgi_buffer_size 256k;
                            fastcgi_param modHeadersAvailable true;
                            fastcgi_read_timeout 7200;
            }
     
          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 SCRIPT_NAME $fastcgi_script_name;          fastcgi_param PATH_INFO $fastcgi_path_info;
              fastcgi_param HTTPS on;
              fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice
              fastcgi_param front_controller_active true;
              fastcgi_read_timeout 180;
              {FASTCGIPASS}
              fastcgi_intercept_errors on;
              fastcgi_request_buffering off; #Available since NGINX 1.7.11
          }
     
          location ~ ^/(?:updater|ocs-provider)(?:$|/) {
              try_files $uri $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)$ {
              try_files $uri /index.php$uri$is_args$args;
              add_header Cache-Control "max-age=15778463";
              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 ~ \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg|map)$ {
              add_header Cache-Control "public, max-age=7200";
              try_files $uri /index.php$uri$is_args$args;
              access_log off;
          }
    
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    That's a handler to process .php files with @php2.
     
  18. itsolon

    itsolon Member

    but why exactly this number i do not have such an htm file?
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    The number does not matter, it's a random name. It just has to be a filename that does not exist on your server.
     
  20. itsolon

    itsolon Member

    ahh thank you then im glad that i didnt create such a file with random content haha
     
    Gwyneth Llewelyn likes this.

Share This Page