[SOLVED] Owncloud Data Directory Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Deleted User 612

[SOLVED] Owncloud Data Directory

Post by Deleted User 612 »

Just started out using Dietpi and it's awesome and very intuitive.

Only problem so far is, having installed ownCloud and then setting up. Tried to set the DataFolder as /var/lib/owncloud/data, as described in the configuration guide, but received an error along the lines of write access denied. Then tried the default option /var/www/owncloud/data and that worked fine.

Does it make a difference having it at /var/www/owncloud/data ? Just wondering whether or not to reinstall ownCloud.

Thanks,

Tin Minnow
Last edited by Deleted User 612 on Sat Jul 09, 2016 9:57 pm, edited 1 time in total.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: Owncloud Data Directory

Post by johnvick »

The recommendation is that your data folder is not under the www directory to make it more secure. Your problem is probably due to wrong file/folder permissions.
Deleted User 612

Re: Owncloud Data Directory

Post by Deleted User 612 »

johnvick wrote:The recommendation is that your data folder is not under the www directory to make it more secure. Your problem is probably due to wrong file/folder permissions.
Thanks, that's good to know. How would I go about changing the file permisions for that folder?
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Owncloud Data Directory

Post by Fourdee »

Tin Minnow wrote:Thanks, that's good to know. How would I go about changing the file permisions for that folder?
Hi Tin,

DietPi-Software sets up a symlink (shortcut) from /var/lib/owncloud/data to /mnt/dietpi_userdata during install.

Lets check to see if its active and check permissions, please run these and paste results:

Code: Select all

ls -lha /var/lib/owncloud/data
ls -lha /mnt/dietpi_userdata
ls -lha $(readlink /mnt/dietpi_userdata)
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Deleted User 612

Re: Owncloud Data Directory

Post by Deleted User 612 »

Fourdee wrote:
Lets check to see if its active and check permissions, please run these and paste results:

Code: Select all

ls -lha /var/lib/owncloud/data
ls -lha /mnt/dietpi_userdata
ls -lha $(readlink /mnt/dietpi_userdata)
Hi Fourdee

These are the results. I did actually reinstall Dietpi and have yet to set up my owncloud admin account/data folder. Still receiving error 'Can't create or write into the data directory /var/lib/owncloud/data ' when trying.

Code: Select all

~# ls -lha /var/lib/owncloud/data
ls: cannot access /var/lib/owncloud/data: No such file or directory
~# ls -lha /mnt/dietpi_userdata
lrwxrwxrwx 1 root root 10 Jul  4 20:49 /mnt/dietpi_userdata -> /mnt/usb_1
~# ls -lha $(readlink /mnt/dietpi_userdata)
total 101M
drwxr-xr-x 4 root     root     4.0K Jul  4 21:19 .
drwxr-xr-x 5 root     root     4.0K Jul  4 20:49 ..
drwx------ 2 root     root      16K Jul  4 20:39 lost+found
drwxrwx--- 3 www-data www-data 4.0K Jul  4 21:26 owncloud_data
-rw------- 1 root     root     100M Jul  4 20:49 .swapfile
Thanks,

Tin Minnow
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Owncloud Data Directory

Post by Fourdee »

Hi Tin,

Thanks for the results.

It looks like the documentation is incorrect.
/var/www/owncloud/data (not /var/lib/*) is the correct location to use when setting up Owncloud for the first time:

Code: Select all

root@DietPi:~# ls -lha /var/www/owncloud/data
lrwxrwxrwx 1 www-data www-data 34 Jul  6 18:24 /var/www/owncloud/data -> /mnt/dietpi_userdata/owncloud_data
I've updated the documentation: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=47#p47. Many thanks for reporting this Tin, and please let me know if this resolves the issue.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Deleted User 612

Re: Owncloud Data Directory

Post by Deleted User 612 »

Ok great, thanks for letting me know, it works perfectly now. And do you know if it is a security risk having it in that directory (/var/www) as johnvick suggested?
johnvick wrote:The recommendation is that your data folder is not under the www directory to make it more secure. Your problem is probably due to wrong file/folder permissions.
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Owncloud Data Directory

Post by Fourdee »

Tin Minnow wrote:Ok great, thanks for letting me know, it works perfectly now. And do you know if it is a security risk having it in that directory (/var/www) as johnvick suggested?
johnvick wrote:The recommendation is that your data folder is not under the www directory to make it more secure. Your problem is probably due to wrong file/folder permissions.
Not sure, but I can't access the data when browsing the web url /var/www/owncloud/data:
http://192.168.0.112/owncloud/data
Its also a symlink, so the physical data is located elsewhere, outside of /var/www.

You can use the below physical location (flash), or symlink (usb/custom) rather than /var/www/owncloud/data during 1st run setup. Either way, its outside the /var/www directory.

Code: Select all

/mnt/dietpi_userdata/owncloud_data
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Deleted User 612

Re: Owncloud Data Directory

Post by Deleted User 612 »

Fourdee wrote:
Tin Minnow wrote:Ok great, thanks for letting me know, it works perfectly now. And do you know if it is a security risk having it in that directory (/var/www) as johnvick suggested?
johnvick wrote:The recommendation is that your data folder is not under the www directory to make it more secure. Your problem is probably due to wrong file/folder permissions.
Not sure, but I can't access the data when browsing the web url /var/www/owncloud/data:
http://192.168.0.112/owncloud/data
Its also a symlink, so the physical data is located elsewhere, outside of /var/www.

You can use the below physical location (flash), or symlink (usb/custom) rather than /var/www/owncloud/data during 1st run setup. Either way, its outside the /var/www directory.

Code: Select all

/mnt/dietpi_userdata/owncloud_data
That's good enough for me!
Post Reply