ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    NextCloud alternate data location

    IT Discussion
    nextcloud nextcloud 14 storage
    4
    24
    2.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • brandon220B
      brandon220
      last edited by steve

      Cannot seem to get an alternate data location to work in Nextcloud. I built a new Fedora (minimal) server VM in my lab. Attached a new vdisk to the vm for data. My main vm is 20 gb and the data is 127 gb. I realize this is irrelevant. I mounted the vdisk to the server as /ncdata

      Again, using @JaredBusch guide (which has never failed to work using the default locations) to set up the new test system. I adjusted the selinux script to reflect the correct data location. I also edited the php.ini file to reflect it as well. Everything works except not being able to write to that /ncdata folder. I have changed the owner of that folder to apache and it is confirmed by issuing ls -la while in that folder. I can find tons of info on moving the data after install but it seems most users go with the defaults. What am I missing? I have been working on this for a while and started over a few times. Still no change in the end result. I am trying to follow "best practices" but struggling.

      JaredBuschJ 1 Reply Last reply Reply Quote 2
      • JaredBuschJ
        JaredBusch @brandon220
        last edited by JaredBusch

        @brandon220 said in NC alternate data location:

        Cannot seem to get an alternate data location to work in Nextcloud. I built a new Fedora (minimal) server VM in my lab. Attached a new vdisk to the vm for data. My main vm is 20 gb and the data is 127 gb. I realize this is irrelevant. I mounted the vdisk to the server as /ncdata

        Again, using @JaredBusch guide (which has never failed to work using the default locations) to set up the new test system. I adjusted the selinux script to reflect the correct data location. I also edited the php.ini file to reflect it as well. Everything works except not being able to write to that /ncdata folder. I have changed the owner of that folder to apache and it is confirmed by issuing ls -la while in that folder. I can find tons of info on moving the data after install but it seems most users go with the defaults. What am I missing? I have been working on this for a while and started over a few times. Still no change in the end result. I am trying to follow "best practices" but struggling.

        Did you turn off SELinux? Not just adjust the settings? sudo setenforce 0

        Does apache own the folder?

        0_1538667094935_54e50575-879c-49fb-a774-371800c18142-image.png

        edit: screenshot form a system that was originally ownCloud 7. It has been upgraded over the years and is now Nextcloud 13 (14 not showing in updater yet).

        JaredBuschJ 1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch @JaredBusch
          last edited by

          @jaredbusch said in NC alternate data location:

          Did you turn off SELinux? Not just adjust the settings? sudo setenforce 0

          Obviously, this is to prove it an issue or not.

          1 Reply Last reply Reply Quote 0
          • brandon220B
            brandon220
            last edited by

            On one of the other test installs from a few days ago, I disabled selinux as a test and it made no difference. I fully believe this is a permissions problem but I am unsure of how to resolve it. It shows apache apache as the owner. It could be that the "root" of /ncdata is still owned by root, but it looks like your example. I did not disable selinux on this one as I am trying to do it correctly from the beginning. Maybe there is a "better" order of what I'm trying to do.

            1 Reply Last reply Reply Quote 0
            • JaredBuschJ
              JaredBusch
              last edited by

              What does your config file have in it?
              sudo cat /var/www/html/nextcloud/config/config.php

              [jbusch@jrd-nc ~]$ sudo cat /var/www/html/nextcloud/config/config.php
              <?php
              $CONFIG = array (
                'instanceid' => 'XXXXXXXXXXXXXXX',
                'passwordsalt' => 'XXXXXXXXXXXXXXX',
                'secret' => 'XXXXXXXXXXXXXXX',
                'trusted_domains' => 
                array (
                  0 => 'nc.daerma.com',
                ),
                'datadirectory' => '/var/www/html/nextcloud/data',
                'overwrite.cli.url' => 'https://nc.daerma.com',
                'dbtype' => 'mysql',
                'version' => '14.0.1.1',
                'dbname' => 'nextcloud',
                'dbhost' => 'localhost',
                'dbport' => '',
                'dbtableprefix' => 'oc_',
                'dbuser' => 'XXXXXXXXXXXXXXX',
                'dbpassword' => 'XXXXXXXXXXXXXXX',
                'logtimezone' => 'UTC',
                'installed' => true,
                'memcache.locking' => '\\OC\\Memcache\\Redis',
                'memcache.local' => '\\OC\\Memcache\\Redis',
                'redis' => 
                array (
                  'host' => 'localhost',
                  'port' => 6379,
                ),
                'htaccess.RewriteBase' => '/',
                'overwriteprotocol' => 'https',
                'mail_smtpmode' => 'smtp',
                'mail_from_address' => 'XXXXXXXXXXXXXXX',
                'mail_domain' => 'XXXXXXXXXXXXXXX',
                'mail_smtphost' => 'XXXXXXXXXXXXXXX',
                'mail_smtpport' => '25',
                'maintenance' => false,
                'loglevel' => 2,
                'theme' => '',
              );
              
              1 Reply Last reply Reply Quote 2
              • brandon220B
                brandon220
                last edited by

                <?php
                $CONFIG = array (
                'instanceid' => 'xxxxxxxxxxxxx',
                );

                Not sure where the config file went. I am puzzled even more now. I had the same issue on the other server but the config.php file was there. May need to start over again.

                black3dynamiteB 1 Reply Last reply Reply Quote 0
                • black3dynamiteB
                  black3dynamite @brandon220
                  last edited by black3dynamite

                  @brandon220 said in NC alternate data location:

                  <?php
                  $CONFIG = array (
                  'instanceid' => 'xxxxxxxxxxxxx',
                  );

                  Not sure where the config file went. I am puzzled even more now. I had the same issue on the other server but the config.php file was there. May need to start over again.

                  You should have config.sample.php file in /var/www/html/nextcloud/config where you would copy and name config.php

                  brandon220B 1 Reply Last reply Reply Quote 0
                  • brandon220B
                    brandon220 @black3dynamite
                    last edited by

                    @black3dynamite The sample config file is there. I have zero clue as to why the normal config.php is missing. I did not delete it.

                    JaredBuschJ 1 Reply Last reply Reply Quote 0
                    • JaredBuschJ
                      JaredBusch @brandon220
                      last edited by

                      @brandon220 said in NC alternate data location:

                      @black3dynamite The sample config file is there. I have zero clue as to why the normal config.php is missing. I did not delete it.

                      Did the install wizard finish? It will not be complete if not.

                      Are you trying to use the changed data location during install? That would explain this.

                      brandon220B 1 Reply Last reply Reply Quote 0
                      • brandon220B
                        brandon220 @JaredBusch
                        last edited by

                        @jaredbusch Yes. I thought that was how it is supposed to work. I assumed that you made sure the permissions were correct and it would update the necessary files to reflect the proper data location.

                        1 Reply Last reply Reply Quote 0
                        • brandon220B
                          brandon220
                          last edited by brandon220

                          I thought that was the correct process to avoid having to "move" the data location later. I set up the folder for the data before the install. I point NC wizard to the location I would like to use for data. That is when the error comes in to play. Everything I read says to do this versus moving the data location after the install. On the install guide by @JaredBusch it says "Personally, if you are going to use a separate disk for the data, I would just mount it to /var/www/html/nextcloud/data" but I am not sure what that is referring to.

                          black3dynamiteB 1 Reply Last reply Reply Quote 0
                          • black3dynamiteB
                            black3dynamite @brandon220
                            last edited by

                            @brandon220 said in NC alternate data location:

                            I thought that was the correct process to avoid having to "move" the data location later. I set up the folder for the data before the install. I point NC wizard to the location I would like to use for data. That is when the error comes in to play. Everything I read says to do this versus moving the data location after the install. On the install guide by @JaredBusch it says "Personally, if you are going to use a separate disk for the data, I would just mount it to /var/www/html/nextcloud/data" but I am not sure what that is referring to.

                            If you have a second disk available like /dev/sdc1, you would mount it to /var/www/html/nextcloud/data

                            And in /etc/fstab file, it would look like something this:
                            /dev/sdc1 /var/www/html/nextcloud/data xfs defaults 0 0

                            brandon220B 1 Reply Last reply Reply Quote 0
                            • brandon220B
                              brandon220 @black3dynamite
                              last edited by brandon220

                              @black3dynamite I will try this. I am assuming you just install using the defaults and only map it in the fstab? This is similar to what I do for my Plex server. I have the "library" mapped to the server via the fstab file and the data is on a NAS.

                              Is there any way to make it work the way I have described?

                              1 Reply Last reply Reply Quote 0
                              • brandon220B
                                brandon220
                                last edited by brandon220

                                @black3dynamite I currently have /dev/sdb1 mounted as /ncdata. I did not edit the fstab file yet.

                                /dev/sdb1 133102084 165696 132936388 1% /ncdata

                                Should I change this first or leave as it is? Seeing that it already has a mount point, I didn't know if it will cause errors.

                                black3dynamiteB 1 Reply Last reply Reply Quote 0
                                • black3dynamiteB
                                  black3dynamite @brandon220
                                  last edited by

                                  @brandon220 said in NC alternate data location:

                                  @black3dynamite I currently have /dev/sdb1 mounted as /ncdata. I did not edit the fstab file yet.

                                  /dev/sdb1 133102084 165696 132936388 1% /ncdata

                                  Should I change this first or leave as it is? Seeing that it already has a mount point, I didn't know if it will cause errors.

                                  Your mount is fine.

                                  1 Reply Last reply Reply Quote 0
                                  • brandon220B
                                    brandon220
                                    last edited by

                                    @black3dynamite I have it working now. Thank you very much for the advice. What I cannot seem to understand is why it won't work by pointing to the /data location in the wizard. It seems from all the reading I have done that it should be possible. Yet, I always fail to make it work that way. Also, in @JaredBusch guide he states "Leave the data folder alone unless you know that you changed it when going through the above instructions." I thought this would be way easier but yet fails.

                                    JaredBuschJ 1 Reply Last reply Reply Quote 0
                                    • JaredBuschJ
                                      JaredBusch @brandon220
                                      last edited by JaredBusch

                                      @brandon220 said in NC alternate data location:

                                      @black3dynamite I have it working now. Thank you very much for the advice. What I cannot seem to understand is why it won't work by pointing to the /data location in the wizard. It seems from all the reading I have done that it should be possible. Yet, I always fail to make it work that way. Also, in @JaredBusch guide he states "Leave the data folder alone unless you know that you changed it when going through the above instructions." I thought this would be way easier but yet fails.

                                      What you did is how it is supposed to work. I’ve done it. But not recently. I will try and set up a test instance at some point, but SW is next week.... yeah, you are going to have to remind me.

                                      brandon220B 1 Reply Last reply Reply Quote 0
                                      • brandon220B
                                        brandon220 @JaredBusch
                                        last edited by

                                        @jaredbusch Sure thing. Running Fedora Server 28 minimal from net install image and NC 14.0.1.
                                        I have tried multiple times and it always fails if I try to move the data location.

                                        1 Reply Last reply Reply Quote 1
                                        • brandon220B
                                          brandon220
                                          last edited by

                                          @JaredBusch I am sure you forgot about this by now... I was looking at @scottalanmiller script at https://gitlab.com/scottalanmiller/nextcloud_fedora_installer and it appears to do what I was doing manually following your guide. He has the script creating /data. I have not run the script on Fedora 28 and changed it to reflect NC 14.0.1 to see if it will work. Ultimately, I want the data on a separate partition. Still cannot get it to work without using fstab to mount my data folder.

                                          travisdh1T 1 Reply Last reply Reply Quote 1
                                          • travisdh1T
                                            travisdh1 @brandon220
                                            last edited by

                                            @brandon220 said in NextCloud alternate data location:

                                            @JaredBusch I am sure you forgot about this by now... I was looking at @scottalanmiller script at https://gitlab.com/scottalanmiller/nextcloud_fedora_installer and it appears to do what I was doing manually following your guide. He has the script creating /data. I have not run the script on Fedora 28 and changed it to reflect NC 14.0.1 to see if it will work. Ultimately, I want the data on a separate partition. Still cannot get it to work without using fstab to mount my data folder.

                                            If you want to manually mount a partition using something other than fstab, then you'd also have to manually start the web server Nextcloud is running on. It's just how the boot process works, fstab is the proper place to mount any drive or partitions.

                                            brandon220B 2 Replies Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post