[SOLVED] Data directory not writeable: Webserver app.

I'm trying to rebuild my nextcloud server after a HDD crash: Yes, lesson learned.
I have it installed, and accessible over the LAN: I can log into website with admin and users.
But I get the warning:
But that link in the warning doesn't work either....
It shouldn't matter, but the device is raspberry pi2: OS is on an sd card. Data directory is on an external AC powered HDD. I've the HDD mounted via fstab
Mount confirms this:
The data directory itself is (apologies for the directory layout: It's just how I managed to copy the data off the old drive):
and it's owned by apache:
As apache user, I can write to the directory:
In the original install I had the data directory as /srv/owncloud/data and that was actually linked from /srv/exthdd/owncloud/data with the external HDD mounted as /srv/exthdd: Not sure why I had that messy link there, but it worked for years: /srv/exthdd/owncloud/data was owned by apache, /srv/exthdd was owned by root.
In the nextcloud config, I have the data directory set as:
Like I say, the web app can see and access the data directory: as a user I can see the files etc:
The nextcloud documentation, and the forums are a bit vague on the data directory, in regards to moving it: It talks about manually messing with the database, but then in the forums that's not neccessary, so it's all conflicting: Given the app can see the data, I don't believe that's the issue.
I'm suspecting it's some ownership issue somewhere, like apache not going across file systems: but again, it can access it. Or a php issue.
I've spent hours on this: I'm totally out of my depth. Any and all advice greatly appreciated: And I'll gladly provide further info it you let me know what you need.
I have it installed, and accessible over the LAN: I can log into website with admin and users.
But I get the warning:
- Code: Select all
Your data directory is not writable Permissions can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/22/go.php?to=admin-dir_permissions.
But that link in the warning doesn't work either....
It shouldn't matter, but the device is raspberry pi2: OS is on an sd card. Data directory is on an external AC powered HDD. I've the HDD mounted via fstab
- Code: Select all
UUID=e2d16de6-5947-4d66-918c-3fe545c74d10 /mnt/temp ext4 defaults,nofail 0 0
Mount confirms this:
- Code: Select all
/dev/sda1 on /mnt/temp type ext4 (rw,relatime,seclabel)
The data directory itself is (apologies for the directory layout: It's just how I managed to copy the data off the old drive):
- Code: Select all
/mnt/temp/owncloudData/owncloud/data
and it's owned by apache:
- Code: Select all
drwxrwx---. 10 apache apache 4096 May 7 17:26 data
As apache user, I can write to the directory:
- Code: Select all
su -s /bin/bash apache
bash-5.1$ pwd
/mnt/temp/owncloudData/owncloud
bash-5.1$ cd data
bash-5.1$ ls test*
ls: cannot access 'test*': No such file or directory
bash-5.1$ touch test
bash-5.1$ ls test*
test
bash-5.1$ rm test
bash-5.1$ ls test*
ls: cannot access 'test*': No such file or directory
In the original install I had the data directory as /srv/owncloud/data and that was actually linked from /srv/exthdd/owncloud/data with the external HDD mounted as /srv/exthdd: Not sure why I had that messy link there, but it worked for years: /srv/exthdd/owncloud/data was owned by apache, /srv/exthdd was owned by root.
In the nextcloud config, I have the data directory set as:
- Code: Select all
'datadirectory' => '/mnt/temp/owncloudData/owncloud/data',
Like I say, the web app can see and access the data directory: as a user I can see the files etc:
The nextcloud documentation, and the forums are a bit vague on the data directory, in regards to moving it: It talks about manually messing with the database, but then in the forums that's not neccessary, so it's all conflicting: Given the app can see the data, I don't believe that's the issue.
I'm suspecting it's some ownership issue somewhere, like apache not going across file systems: but again, it can access it. Or a php issue.
I've spent hours on this: I'm totally out of my depth. Any and all advice greatly appreciated: And I'll gladly provide further info it you let me know what you need.