NextCloud Installation Q & A

    • OMV 3.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • tinh_x7 wrote:

      OwnCloud vhost setup is slow for NextCloud.
      You can test it, but don't use it for the long run.
      Would it make sense to do the setup with owncloud config and later paste the vhost config from the tutorial?

      The config is the only thing, that I have changed now...


      tinh_x7 wrote:

      Double check your configuration.
      It may take more than 2 or 3 times to get it right.
      :D ;( I am more around 10 to 15 times double checking and retrying. What else than the vhost config could I check/adapt? Could it also be an OMV3 vs OMV4 difference?
    • kolmberger wrote:

      Would it make sense to do the setup with owncloud config and later paste the vhost config from the tutorial?
      No. That's the reason I wrote the tutorial.

      The tutorial work for OMV3 and OMV4.
      OMV4 just need to install additional dependencies.
      Check some the previous posts.


      By the way, check your NC permissions.
      Ensure it's www-data:www-data

      Since you aren't using SSL at the moment, set : fastcgi_param HTTPS off

      Copy and paste your vhost config here, maybe some other users can help you.

      I just looked page 1, and one of the users had the same error like yours: forum.openmediavault.org/index…xtCloud-Installation-Q-A/
      OMV v4.0
      Asus Z97-A/3.1; i3-4370
      32GB RAM Corsair Vengeance Pro
      4x3TB RAID10

      The post was edited 2 times, last by tinh_x7 ().

    • tinh_x7 wrote:

      By the way, check your NC permissions.
      Ensure it's www-data:www-data
      Where exactly can I check this, here?

      There it looks like this:

      It looks similar with folder "www".

      My vhost config:

      Shell-Script

      1. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
      2. add_header X-Content-Type-Options nosniff;
      3. # add_header X-Frame-Options "SAMEORIGIN";
      4. add_header X-XSS-Protection "1; mode=block";
      5. add_header X-Robots-Tag none;
      6. add_header X-Download-Options noopen;
      7. add_header X-Permitted-Cross-Domain-Policies none;
      8. location = /robots.txt {
      9. log_not_found off;
      10. allow all;
      11. access_log off;
      12. }
      13. # The following 2 rules are only needed for the user_webfinger app.
      14. # Uncomment it if you're planning to use this app.
      15. #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
      16. #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
      17. # last;
      18. location = /.well-known/carddav {
      19. return 301 $scheme://$host/remote.php/dav;
      20. }
      21. location = /.well-known/caldav {
      22. return 301 $scheme://$host/remote.php/dav;
      23. }
      24. # set max upload size
      25. client_max_body_size 50G;
      26. fastcgi_buffers 64 4K;
      27. # Disable gzip to avoid the removal of the ETag header
      28. gzip off;
      29. # Uncomment if your server is build with the ngx_pagespeed module
      30. # This module is currently not supported.
      31. #pagespeed off;
      32. error_page 403 /core/templates/403.php;
      33. error_page 404 /core/templates/404.php;
      34. location / {
      35. rewrite ^ /index.php$uri;
      36. }
      37. location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
      38. deny all;
      39. }
      40. location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
      41. deny all;
      42. }
      43. location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) {
      44. fastcgi_split_path_info ^(.+\.php)(/.*)$;
      45. include fastcgi_params;
      46. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      47. fastcgi_param PATH_INFO $fastcgi_path_info;
      48. #fastcgi_param HTTPS on;
      49. fastcgi_param HTTPS off;
      50. #Avoid sending the security headers twice
      51. fastcgi_param modHeadersAvailable true;
      52. fastcgi_param front_controller_active true;
      53. fastcgi_pass $socket;
      54. fastcgi_intercept_errors on;
      55. }
      56. location ~ ^/(?:updater|ocs-provider)(?:$|/) {
      57. try_files $uri/ =404;
      58. index index.php;
      59. }
      60. # Adding the cache control header for js and css files
      61. # Make sure it is BELOW the PHP block
      62. location ~* \.(?:css|js|woff|svg|gif)$ {
      63. try_files $uri /index.php$uri$is_args$args;
      64. add_header Cache-Control "public, max-age=7200";
      65. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
      66. add_header X-Content-Type-Options nosniff;
      67. add_header X-Frame-Options "SAMEORIGIN";
      68. add_header X-XSS-Protection "1; mode=block";
      69. add_header X-Robots-Tag none;
      70. add_header X-Download-Options noopen;
      71. add_header X-Permitted-Cross-Domain-Policies none;
      72. # Optional: Don't log access to assets
      73. access_log off;
      74. }
      75. location ~* \.(?:png|html|ttf|ico|jpg|jpeg)$ {
      76. try_files $uri /index.php$uri$is_args$args;
      77. # Optional: Don't log access to other assets
      78. access_log off;
      79. }
      Display All



      tinh_x7 wrote:

      Since you aren't using SSL at the moment, set : fastcgi_param HTTPS off
      Already applied.


      tinh_x7 wrote:

      I just looked page 1, and one of the users had the same error like yours: forum.openmediavault.org/index…xtCloud-Installation-Q-A/
      I found that too, yet I have used the method to upload that install php file. In my next try (tries :P ) I will try to use the download method.

      If you find something wrong in the sharedfolders config or else, I am happy to learn by it!

      Thanks again.
    • Ok, couple steps ahead 8o I processed the downloader method, as described in the tutorial, from step 4 on, that worked finally! But I don't know why... ?(

      My procedure according to steps 4 to 7:

      Source Code

      1. cd /srv/dev-disk-by-label-Testraid/www/nextcloud
      2. wget https://download.nextcloud.com/server/releases/nextcloud-13.0.4.zip
      3. apt-get install unzip # because it told me first, "command not found"...?
      4. unzip nextcloud-13.0.4.zip
      5. cp -r nextcloud/. /srv/dev-disk-by-label-Testraid/www/nextcloud
      6. cd /srv/dev-disk-by-label-Testraid/www/nextcloud


      After that, I was able to execute and finish the NC setup.

      Next,I ran into problems with steps 8, 9 and 10 because I could not locate the files in my NC13 setup. I also had NC telling me in the security checks, that OPcache settings are not correct.

      Following, my steps in a short how it worked out for me (after fiddling a lot in this many config files):

      - after checking, installed redis-server and php7.0-redis
      - in my: /srv/dev-disk-by-label-Testraid/www/nextcloud
      - changed: config.php to (that is one part, that was quite unclear where and in which file to do)

      PHP Source Code

      1. <?php
      2. $CONFIG = array (
      3. 'instanceid' => 'abcdefg12345',
      4. 'passwordsalt' => 'abcdefgh12345678',
      5. 'secret' => '12345678sdfghjkl',
      6. 'trusted_domains' =>
      7. array (
      8. 0 => 'localhost',
      9. 1 => 'some.domain.com',
      10. 2 => '192.168.x.x',
      11. ),
      12. 'datadirectory' => '/srv/dev-disk-by-label-Testraid/www/nextcloud/data',
      13. 'overwrite.cli.url' => 'http://192.168.x.x:90',
      14. 'dbtype' => 'mysql',
      15. 'version' => '13.0.4.0',
      16. 'dbname' => 'nextcloud',
      17. 'dbhost' => 'localhost',
      18. 'dbport' => '',
      19. 'dbtableprefix' => 'oc_',
      20. 'dbuser' => 'xyz',
      21. 'dbpassword' => '1234578dfghj32456',
      22. 'installed' => true,
      23. 'memcache.local' => '\OC\Memcache\Redis',
      24. 'memcache.locking' => '\OC\Memcache\Redis',
      25. 'redis' => array(
      26. 'host' => 'localhost',
      27. 'port' => 6379,
      28. ),
      29. );
      Display All
      - removed nextcloud.zip and the nextcloud dir
      - created the script for strong permissions (which hopefully helps for something):

      Shell-Script

      1. #!/bin/bash
      2. ocpath='/srv/dev-disk-by-label-Testraid/www/nextcloud'
      3. htuser='www-data'
      4. htgroup='www-data'
      5. rootuser='root'
      6. printf "Creating possible missing Directories\n"
      7. mkdir -p $ocpath/data
      8. mkdir -p $ocpath/updater
      9. printf "chmod Files and Directories\n"
      10. find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
      11. find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
      12. printf "chown Directories\n"
      13. chown -R ${rootuser}:${htgroup} ${ocpath}/
      14. chown -R ${htuser}:${htgroup} ${ocpath}/apps/
      15. chown -R ${htuser}:${htgroup} ${ocpath}/config/
      16. chown -R ${htuser}:${htgroup} ${ocpath}/data/
      17. chown -R ${htuser}:${htgroup} ${ocpath}/themes/
      18. chown -R ${htuser}:${htgroup} ${ocpath}/updater/
      19. chmod +x ${ocpath}/occ
      20. printf "chmod/chown .htaccess\n"
      21. if [ -f ${ocpath}/.htaccess ]
      22. then
      23. chmod 0644 ${ocpath}/.htaccess
      24. chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
      25. fi
      26. if [ -f ${ocpath}/data/.htaccess ]
      27. then
      28. chmod 0644 ${ocpath}/data/.htaccess
      29. chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
      30. fi
      Display All

      - executed: bash setstrongpermissionnc (couple of times)
      - service nginx restart (couple of times)

      - opcache problem solved by editing: etc/php/70/mods-available/opcache.ini

      Source Code

      1. ; configuration for php opcache module
      2. ; priority=10
      3. zend_extension=opcache.so
      4. zend_extension=/usr/lib/php/20151012/opcache.so
      5. opcache.enable=1
      6. opcache.enable_cli=1
      7. opcache.interned_strings_buffer=8
      8. opcache.max_accelerated_files=10000
      9. opcache.memory_consumption=128
      10. opcache.save_comments=1
      11. opcache.revalidate_freq=1
      Display All

      Now I need to take care about the message, that "files haven't passed the integrity check" - a lot of files indeed...
      And finally to enable SSL with my existing lets-encrypt certficate.

      If my notes help others, my pleasure.

      thanks especially to tinh_x7
      :thumbsup:
    • Glad you got NC working.

      To view permissions, connect to your server via SSH with Putty or Terminal (Mac/Linux).

      1. cd srv/dev-disk-by-label-Testraid/www/nextcloud
      2. ls -la

      "files haven't passed the integrity check" : telling you that some files integrity don't match with it's original hash.
      You may have to copy & replace those files from the nextcloud-vXYZ.zip into your server. Next, chown entire NC dir to www-data:www-data.
      Then re-scan the files from NC admin panel.

      kolmberger wrote:

      - executed: bash setstrongpermissionnc (couple of times)
      - service nginx restart (couple of times)
      When your NC is working like you wanted, then run this script only once.
      OMV v4.0
      Asus Z97-A/3.1; i3-4370
      32GB RAM Corsair Vengeance Pro
      4x3TB RAID10

      The post was edited 1 time, last by tinh_x7 ().

    • Users Online 3

      3 Guests