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 installed ISPconfig 3 (following this tutorial: https://www.howtoforge.com/perfect-server-centos-6.4-x86_64-nginx-dovecot-ispconfig-3 btw, thank you) a few days ago and everything is working great, but...

    I want ownCloud (for myself, not for my clients) and I created a client (me), bought a domain, configured DNS's and started an install.

    I followed ownCloud's guidelines when installing on nginx (from here: http://doc.owncloud.org/server/7.0/admin_manual/installation/nginx_configuration.html) and pasted the entire code under "nginx Directives" in Options tab of my newly created domain. Should I pasted it there?

    After setting up username, password and database (I selected MySQL which I previously created with ISPconfig) I was presented with the log in screen where I logged in for the first time and after that I got an error 404.
    Here is the screenshot: http://i.imgur.com/XIrfsmz.png

    Where did I go wrong?
    Is this an ISPconfig issue or should I write to ownCloud?
     
  2. inside83

    inside83 Member

    Needless to say that I spent the last two hours browsing forums in search of a solution.
    I even tried to split the nginx configuration (mentioned in ownCloud's manual) to (1)break-if-return-rewrite-set and (2)everything-else and adding the first part to "Rewrite Rules" in Redirect tab of my domain and the second part under "nginx Directives" in Options tab.
    Didn't work...
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    The nginx directies from owncloud website are the complete nginx config for a standalone server without controlpanel, so tehy conflict / overpap with the setup from ISPConfig. Please empty the nginx directives field and then paste only the directives from here (the grey underlayed text):

    https://timmehosting.de/owncloud-hosting-auf-nginx
     
  4. inside83

    inside83 Member

    Thank you for the quick reply, really.
    I just did that and its still the same.
    Should I restart nginx?
     
  5. inside83

    inside83 Member

    Now, after I repeatedly refreshed the Chrome tab I got 502 error:
    The following error occurred:
    This server received an invalid response from an upstream server it accessed to fulfill the request.
    If you get this message repeatedly please contact the webmaster.
     
  6. inside83

    inside83 Member

    I just did:
    /etc/init.d/nginx reload
    /etc/init.d/nginx restart

    Still error 502
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    No, thats not nescessary.

    Try to remove this part from the nginx directives field:

    Code:
    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;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_intercept_errors on;
    fastcgi_index index.php;
    fastcgi_buffers 64 4K;
    }
    
     
  8. inside83

    inside83 Member

  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Pleasetry this one, it is for owncloud 7.

    Code:
    location ~ \.php$ {
                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;
            }
    
            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;
            }
    
            location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
                            expires 30d;
                            access_log off;
            } 
     
    ahrasis and inside83 like this.
  10. inside83

    inside83 Member

    THANK YOU!!!
    Finally everything works.
     
  11. pebkac

    pebkac Member HowtoForge Supporter

    I have ISPConfig 3 running Ubuntu 12.04. I have this exact same problem. I followed all the above steps, with the exact same results. Except for the last part, it still just allows me to log in but cannot click anything.

    Anything else I can try?
     
  12. inside83

    inside83 Member

    @pebkac
    So strange, I was just now on this thread copying the nginx directives for another server :)
    And worked fine on Debian 7, nginx.
    Try erasing all other lines in nginx directives and paste the code above - then wait a minute (literally) for the ISPconfig's cron and try.
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    When it works on Debian 7, then it should work on Ubuntu 12.04 in my opinion. Maybe @pebkac uses a different Owncloud version? The rules above are for owncloud 7.
     
  14. inside83

    inside83 Member

    I can confirm that it works on two servers running Debian wheezy (nginx 1.2.1) and CentOS 6.5 (nginx 1.0.15) and ownCloud 7.0.4.2
     
  15. pebkac

    pebkac Member HowtoForge Supporter

    I also am using owncloud 7, just installed it yesterday. I deleted everything in the nginx directive and c/p the code that worked for you and still it allows me to log in but I get the attached.

    Could it be my version of ISPCOnfig, 3.0.4.6?
     

    Attached Files:

  16. inside83

    inside83 Member

    My version is 3.0.5.4p5 on both servers running ownCloud.
     
  17. pebkac

    pebkac Member HowtoForge Supporter

    I'll try updating and see what happens. Thanks.
     
  18. inside83

    inside83 Member

    Try different browser first or clear your browser cache.
     
  19. pebkac

    pebkac Member HowtoForge Supporter

    The ISPConfig upgrade did the trick. I was already trying different browsers and using incognito mode.

    Thanks!
     
  20. inside83

    inside83 Member

Share This Page