Owncloud v8.0.2 on nginx running ISPconfig

Discussion in 'General' started by CrypticDesigns, Apr 17, 2015.

  1. Hello,

    I would like to get Owncloud running on a subdomain in ISPconfig. I added a subdomain redirection to the folder /cloud , added a DNS records, and uploaded all the owncloud files to the directory. Then tried it out, the installation was succesfull however when I tried to login to the panel I got a 500 internal error. The best thing that came up in my mind was that it got something to do with the vhost and rewrite settings etc. So removed the subdomain "if http request is subdomain then redirect to directory", I made a new vhost file in nginx and made a symlink for it. Any way, doesn't work.... When I try to restart nginx it give me a FAIL. I checked the nginx log and outputting the following:

    Code:
    2015/04/17 16:21:56 [emerg] 17719#0: "location" directive is not allowed here in /etc/nginx/sites-enabled/100-domain.net.vhost:25
    nginx vhost:
    Code:
    server {
            listen *:80;
    
    
            server_name cloud.domain.net www.cloud.domain.net;
    
            root   /var/wwwdomain.net/web/cloud;
    
            }
    
    
            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.net/cloud/error.log;
            access_log /var/log/ispconfig/httpd/domain.net/cloud/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/client1/web5/web/stats/.htpasswd_stats;
            }
    
            location ^~ /awstats-icon {
                alias /usr/share/awstats/icon;
            }
    
            location ~ \.php$ {
                try_files /b615814d8f2c19dbcb25b1fbae07ce38.htm @php;
            }
    
            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;
            }
    
    }
    Anybody got something I could try?
    Thanks for reading
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You should add the subdomain as new website, puttings several cms/shops/or other software into the same website is always a bad idea. so the steo sare:

    Click on new website, enter sub.domain.tld into the domain field, press save and then install owncloud into thsi new website.
     

Share This Page