Page 1 of 1

I think it's not possible to install nextcloud on vesta..

Posted: Wed Jan 23, 2019 1:58 pm
by murdocklawless
I've nginx+apache config on vesta. whatever I tried in nginx config files I got 404 page. what I should do, I don't know?

Re: I think it's not possible to install nextcloud on vesta..

Posted: Fri Jan 25, 2019 9:18 am
by scottw
same issue here.

Re: I think it's not possible to install nextcloud on vesta..

Posted: Sat Jan 26, 2019 6:21 am
by mehargags
murdocklawless wrote:
Wed Jan 23, 2019 1:58 pm
whatever I tried in nginx config files I got 404 page?
So please mention "what all you did", post your config so we can look and suggest what needs to be fixed.

For your information, I'm successfully running two Nextcloud sites on VestaCP from last 3 years

Re: I think it's not possible to install nextcloud on vesta..

Posted: Fri Feb 15, 2019 9:08 pm
by murdocklawless
scottw wrote:
Fri Jan 25, 2019 9:18 am
same issue here.
if you running php-fpm, set backend template "socket" from web section.

Re: I think it's not possible to install nextcloud on vesta..

Posted: Sun Feb 17, 2019 11:58 pm
by Felix
I am also a happy user of 2 Nextcloud instances and 1 ownCloud instance. All hosted on VESTA, apache+nginx, working out of the box (no fancy configuration).

The OP is providing too little info for anyone to help.

Re: I think it's not possible to install nextcloud on vesta..

Posted: Mon Feb 18, 2019 12:19 pm
by murdocklawless
I'm hosting nextcloud on my vps with nignx + php-fpm and also hosting in home server on bananapi with apache + php-fpm.

Re: I think it's not possible to install nextcloud on vesta..

Posted: Mon Jun 15, 2020 8:10 am
by youradds
I know I'm a little late to the party, but I just got nginx + nextcloud working. For some reason you don't seem to be able to upload attachments here? So for my server, you login as root and go to: /usr/local/vesta/data/templates/web/nginx/php-fpm

In there, create 2 new files.

nextcloud.tpl , with:

Code: Select all

server {
    listen      %ip%:%web_port%;
    listen      [::]:%web_port%;
    server_name %domain_idn% %alias_idn%;
    root        %docroot%;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/%domain%.log combined;
    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
    error_log   /var/log/nginx/domains/%domain%.error.log error;

    location '/.well-known/acme-challenge' {
       default_type "text/plain";
       allow all;
       break;
    }

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

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

    location / {
        rewrite ^(.*) https://%domain%$1 permanent;
    }

    include     %home%/%user%/conf/web/nginx.%domain%.conf*;
}
and then nextcloud.stpl:

Code: Select all

server {
    listen      %ip%:%web_ssl_port% ssl http2;
    listen      [::]:%web_ssl_port% ssl http2;
    server_name %domain_idn% %alias_idn%;
    root        %docroot%;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/%domain%.log combined;
    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
    error_log   /var/log/nginx/domains/%domain%.error.log error;

    #ssl         on;
    ssl_certificate      %ssl_pem%;
    ssl_certificate_key  %ssl_key%;

    add_header X-Content-Type-Options nosniff always;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Robots-Tag none always;
    add_header X-Download-Options noopen always;
    add_header X-Permitted-Cross-Domain-Policies none always;
    add_header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload" always;


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

  location = /data/\.ocdata {
      access_log off;
  }

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

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

      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 ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|ocm-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; # necessary for owncloud to detect the contextroot https://github.com/owncloud/core/blob/v10.0.0/lib/private/AppFramework/Http/Request.php#L603
          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; # increase default timeout e.g. for long running carddav/ caldav syncs with 1000+ entries

          #fastcgi_pass php-handler;
          fastcgi_intercept_errors on;
          fastcgi_request_buffering off; #Available since NGINX 1.7.11


           location ~ [^/]\.php(/|$) {
               fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
               if (!-f $document_root$fastcgi_script_name) {
                   return  404;
               }

               fastcgi_pass    %backend_lsnr%;
               fastcgi_index   index.php;
               include         /etc/nginx/fastcgi_params;
           }

      }

      location ~ ^/(?:updater|ocs-provider|ocm-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" always;

          # Add headers to serve security related headers (It is intended to have those duplicated to the ones above)
          # The always parameter ensures that the header is set for all responses, including internally generated error responses.
          # Before enabling Strict-Transport-Security headers please read into this topic first.
          # https://www.nginx.com/blog/http-strict-transport-security-hsts-and-nginx/

          add_header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload" always;
          add_header X-Content-Type-Options nosniff always;
          add_header X-Frame-Options "SAMEORIGIN" always;
          add_header X-XSS-Protection "1; mode=block" always;
          add_header X-Robots-Tag none always;
          add_header X-Download-Options noopen always;
          add_header X-Permitted-Cross-Domain-Policies none always;
          # Optional: Don't log access to assets
          access_log off;
      }

      location ~ \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg|map|json)$ {
          add_header Cache-Control "public, max-age=7200" always;
          try_files $uri /index.php$uri$is_args$args;
          # Optional: Don't log access to other assets
          access_log off;
      }

#    location / {
#
#        include     %home%/%user%/conf/web/nginx.%domain%.rules.conf*;

#        try_files $uri $uri/ /index.php?$args;

#        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
#            expires     max;
#        }
#
#        location ~ [^/]\.php(/|$) {
#            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#            if (!-f $document_root$fastcgi_script_name) {
#                return  404;
#            }
#
#            fastcgi_pass    %backend_lsnr%;
#            fastcgi_index   index.php;
#            include         /etc/nginx/fastcgi_params;
#        }
#    }

    error_page  403 /error/404.html;
    error_page  404 /error/404.html;
    error_page  500 502 503 504 /error/50x.html;

    location /error/ {
        alias   %home%/%user%/web/%domain%/document_errors/;
    }

    location ~* "/\.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
    }



    include     /etc/nginx/conf.d/phpmyadmin.inc*;
    include     /etc/nginx/conf.d/phppgadmin.inc*;
    include     /etc/nginx/conf.d/webmail.inc*;

    include     %home%/%user%/conf/web/nginx.%domain%.conf*;
}
I've got it working fine using that setup. Hope it helps someone :)

Cheers

Andy

Re: I think it's not possible to install nextcloud on vesta..

Posted: Tue Jun 16, 2020 10:30 pm
by ah_ah_arthur
murdocklawless wrote:
Fri Feb 15, 2019 9:08 pm
scottw wrote:
Fri Jan 25, 2019 9:18 am
same issue here.
if you running php-fpm, set backend template "socket" from web section.
OH MY. You just saved a life good sir.

^ Guys, confirmed this worked for me

THANK YOU SO MUCH I love this community