NextCloud Installation Q & A

    • OMV 3.x

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

    • Thanks, Stramm, but like i said, I fixed it by editing my fastcgi_pass $socket; to something else. I am just trying to understand why set $socket "unix:/var/run/fpm-xxxxxxxxxxxx.sock was incorrect on my second attempt at this.

      tinh_x7 wrote:

      set $socket ...... in the /etc/nginx/sites-available/zzz-omv-nginx) is auto generated for you, no need to modify that.
      ... yeah, and mine was "autogenerated" wrong.
    • I had a lot of problems with my NC13 installation after updating to OMV4 but it was my own fault in the end.
      I reconfigured a new pool and server but this did not fix my issues as i still got internal server errors.

      My Problem, i didnt check the nextcloud logs.

      I still had the memcache APCu Settings in my config.php


      Source Code

      1. 'memcache.local' => '\\OC\\Memcache\\APCu',
      So i disabled this line and it finally started again :)

      After i installed the apcu modul using:


      sudo apt-get install php7.0-apcu
      I could enable this option again now my nextcloud server is running happily again like before.
      Only thing missing is fail2ban
    • Hey
      I have a problem with NC installation using OMV / Docker. As I am a new Raspberry user, I do everything like in tutorials, and everything is OK. I installed the NC from the terminal according to the advice on the OMV website and I succeeded. At the next RP I wanted to do it with the help of Docer - and the server did not work. After downloading the image and running - error 404. Can anyone tell you how to set Modify Container? Clean installation of the OMV (the newest) system, server running, I added Docer repositories.
    • OMV version: 3.0.99
      Nextcloud version: 13.0.1

      I am stuck in step 7 of the installation guide. I go to http://<ip>:90 and keep getting 404 error. Error log says "Primary script unknown" while reading response header from upstream.

      I followed the exact same steps but did not turn SSL on yet. This is my server extra options:

      Source Code

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


      To debug, I added the following to http block of nginx.conf:

      Source Code

      1. log_format scripts '$document_root$fastcgi_script_name > $request';
      And this to the site's server block:

      Source Code

      1. access_log /var/log/nginx/scripts.log scripts;

      I then tried to access the site and found this in this log I created:

      Source Code

      1. /srv/dev-disk-by-label-DATA/www/nextcloud/core/templates/404.php > GET / HTTP/1.1

      I am unable to figure out the problem? Please help...
    • tinh_x7 wrote:

      Can you post your NextCloud's Nginx setup screenshot ?
      I upgraded OMV from 3 to 4 now and reinstalled mysql and nginx and set up everything again. I am still facing the 404 not found error. Here is the screenshot you requested. Thank you!



      Here is also screenshot of permissions inside the nextcloud folder:

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

    • tinh_x7 wrote:

      Your 'PHP: Default Config" is turned OFF.

      Turn it ON, and try again.
      Thanks for the reply. Ok I am very confused now. Should I use the php default config like you mentioned or use the pool that we create in earlier step? I dug in more and found out that, for some reason (this bug needs to be investigated), the .conf and .sock file was not created for the pool that we created and hence fastcgi_pass $socket wasn't working like @z-vap had faced. I saved the pool config again, and this time .conf and .sock were created for the pool. So after that, I changed it back to fastcgi_pass $socket and I didn't face 502 Bad Gateway. Now back to my bigger problem, if we're using the pool, we shouldn't use the PHP default config right?

      The post was edited 6 times, last by pratith ().

    • pratith wrote:

      mrboki wrote:

      That's what I'm saying, I cannot even start the installation.
      @mrboki, I think I am facing the same problem. Were you able to fix the 404 error?
      Hello, no I did not as I got no response. The problem is that the installation guide is not working.

      "2. Un-check the "default config' option in the PHP section. (Credit to @Zocker1996)"

      I tried with checked but it's not working either... same 404 error. Did you solve this with .conf and .sock?
    • mrboki wrote:

      pratith wrote:

      mrboki wrote:

      That's what I'm saying, I cannot even start the installation.
      @mrboki, I think I am facing the same problem. Were you able to fix the 404 error?
      Hello, no I did not as I got no response. The problem is that the installation guide is not working.
      "2. Un-check the "default config' option in the PHP section. (Credit to @Zocker1996)"

      I tried with checked but it's not working either... same 404 error. Did you solve this with .conf and .sock?
      Nope. What I was explaining was the cause behind 502 Bad Gateway error. I tried checked and unchecked too and getting same 404 error. I think I am giving up and going to try with docker. This is too much of a mess.
    • Ensure your Nginx and PHP are running.
      Some users have the same issue like yours.
      It could be incorrect socket.

      You can try to turn off the PHP default configure option, and do the followings:

      Replace fastcgi_pass $socket with fastcgi_pass /run/php/php7.0-fpm.sock;

      service nginx restart
      service php7.0-fpm restart
      OMV v4.0
      Asus Z97-A/3.1; i3-4370
      32GB RAM Corsair Vengeance Pro
      4x3TB RAID10

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

    • tinh_x7 wrote:

      Ensure your Nginx and PHP are running.
      Some users have the same issue like yours.
      It could be incorrect socket.

      You can try to turn off the PHP default configure option, and do the followings:

      Replace fastcgi_pass $socket with fastcgi_pass /run/php/php7.0-fpm.sock;

      service nginx restart
      service php7.0-fpm restart
      I had luck with this change and could install nextcloud 13 on omv4 successfully. Thanks for your hard work and investigation!
      Now I have checked my server against the ssllabs servertest and got - i think - a https-redirection-loop.

      [IMG:https://i.imgur.com/6gaOzzX.png]

      Do you experience the same with your config or have an idea what the cause could be?


      My nginx config:

      Source Code

      1. server {
      2. listen 443 ssl;
      3. listen [::]:443 ssl;
      4. ssl_certificate /etc/ssl/certs/cert.crt;
      5. ssl_certificate_key /etc/ssl/private.key;
      6. set $root_path "/path/to/root";
      7. root $root_path;
      8. index index.php;
      9. set $socket "unix:/var/run/fpm-b4f19467-563b-4681-b8e4-582ee046726b.sock";
      10. location ~ \.php$ {
      11. include snippets/fastcgi-php.conf;
      12. fastcgi_pass $socket;
      13. }
      14. access_log /var/log/nginx/f0abf6c7-9c36-4f12-b323-6f499765a98e-access.log;
      15. error_log /var/log/nginx/f0abf6c7-9c36-4f12-b323-6f499765a98e-error.log;
      16. large_client_header_buffers 4 8k;
      17. # Set HTTP Strict Transport Security (HSTS) to 365 days
      18. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
      19. add_header X-Content-Type-Options nosniff;
      20. add_header X-Frame-Options "SAMEORIGIN";
      21. add_header X-XSS-Protection "1; mode=block";
      22. add_header X-Robots-Tag none;
      23. add_header X-Download-Options noopen;
      24. add_header X-Permitted-Cross-Domain-Policies none;
      25. # Use self generated Diffie-Hellman parameter for DHE ciphersuites
      26. ssl_dhparam /etc/ssl/dhparams4096.pem;
      27. # Session resumption
      28. ssl_session_timeout 1d;
      29. ssl_session_cache shared:SSL:50m;
      30. ssl_session_tickets off;
      31. # OCSP stapling
      32. ssl_stapling on;
      33. ssl_stapling_verify on;
      34. resolver 8.8.8.8 8.8.4.4;
      35. ssl_trusted_certificate /etc/letsencrypt/live/domain.xxx/chain.pem;
      36. # modern cipher configuration
      37. ssl_protocols TLSv1.2;
      38. ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACH$
      39. ssl_prefer_server_ciphers on;
      40. location = /robots.txt {
      41. log_not_found off;
      42. allow all;
      43. access_log off;
      44. }
      45. # The following 2 rules are only needed for the user_webfinger app.
      46. # Uncomment it if you're planning to use this app.
      47. #rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
      48. #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
      49. # last;
      50. location = /.well-known/carddav {
      51. return 301 $scheme://$host/remote.php/dav;
      52. }
      53. location = /.well-known/caldav {
      54. return 301 $scheme://$host/remote.php/dav;
      55. }
      56. # set max upload size
      57. client_max_body_size 50G;
      58. fastcgi_buffers 64 4K;
      59. # Disable gzip to avoid the removal of the ETag header
      60. gzip off;
      61. # Uncomment if your server is build with the ngx_pagespeed module
      62. # This module is currently not supported.
      63. #pagespeed off;
      64. error_page 403 /core/templates/403.php;
      65. error_page 404 /core/templates/404.php;
      66. location / {
      67. rewrite ^ /index.php$uri;
      68. }
      69. location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
      70. deny all;
      71. }
      72. location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
      73. deny all;
      74. }
      75. location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates$
      76. fastcgi_split_path_info ^(.+\.php)(/.*)$;
      77. include fastcgi_params;
      78. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      79. fastcgi_param PATH_INFO $fastcgi_path_info;
      80. fastcgi_param HTTPS on;
      81. #Avoid sending the security headers twice
      82. fastcgi_param modHeadersAvailable true;
      83. fastcgi_param front_controller_active true;
      84. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
      85. fastcgi_intercept_errors on;
      86. }
      87. location ~ ^/(?:updater|ocs-provider)(?:$|/) {
      88. try_files $uri/ =404;
      89. index index.php;
      90. }
      91. # Adding the cache control header for js and css files
      92. # Make sure it is BELOW the PHP block
      93. location ~* \.(?:css|js|woff|svg|gif)$ {
      94. try_files $uri /index.php$uri$is_args$args;
      95. add_header Cache-Control "public, max-age=7200";
      96. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
      97. add_header X-Content-Type-Options nosniff;
      98. add_header X-Frame-Options "SAMEORIGIN";
      99. add_header X-XSS-Protection "1; mode=block";
      100. add_header X-Robots-Tag none;
      101. add_header X-Download-Options noopen;
      102. add_header X-Permitted-Cross-Domain-Policies none;
      103. # Optional: Don't log access to assets
      104. access_log off;
      105. }
      106. location ~* \.(?:png|html|ttf|ico|jpg|jpeg)$ {
      107. try_files $uri /index.php$uri$is_args$args;
      108. # Optional: Don't log access to other assets
      109. access_log off;
      110. }
      111. }
      Display All

      The post was edited 3 times, last by FixXx ().

    • pratith wrote:

      tinh_x7 wrote:

      Your 'PHP: Default Config" is turned OFF.

      Turn it ON, and try again.
      Thanks for the reply. Ok I am very confused now. Should I use the php default config like you mentioned or use the pool that we create in earlier step? I dug in more and found out that, for some reason (this bug needs to be investigated), the .conf and .sock file was not created for the pool that we created and hence fastcgi_pass $socket wasn't working like @z-vap had faced. I saved the pool config again, and this time .conf and .sock were created for the pool. So after that, I changed it back to fastcgi_pass $socket and I didn't face 502 Bad Gateway. Now back to my bigger problem, if we're using the pool, we shouldn't use the PHP default config right?
      This is an interesting observation. I will need to save this for the future.
    • Users Online 2

      2 Guests