Убедитесь что в корне каталога данных присутствует файл ocdata
Nextcloud: изменяем путь хранилища файлов
Недавно опубликовал материал про установку и первоначальную настройку Nextcloud.
У материала появился первый комментарий:
Интересно бы было узнать как при установке поменять место хранения файлов nextcloud, а именно систему я поставил к примеру на SSD но есть аппаратный RAID 10 как на него перенести место хранение файлов?
Хороший комментарий, и жизненный пример.
В этой заметке рассмотрим, как перенести хранилище Nextcloud в другое место.
Во первых место хранения можно выбрать в момент инсталляции (Поле «Каталог с данными»):
Во вторых — каталог с данными можно изменить и после успешной установки.
Вводные:
Первым делом создаем новую корневую директорию для данных:
Переводим Nextcloud в режим обслуживания:
Переносим данные и рекурсивно назначаем права:
Меняем путь к datadirectory в конфигурационном файле (обязательно сохранив синтаксис):
Отключаем режим обслуживания:
Первым делом зайдем в настройки сервера: https://cloud.mydimain.ru/settings/admin/overview.
Возможно, что там будет похожая ошибка:
Были обнаружены ошибки конфигурации.
Ошибка запуска задачи планировщика с использованием интерфейса командной строки.
Подробное сообщение об ошибке: Каталог данных должен быть указан в виде абсолютного пути
Проверьте в значение параметра «datadirectory» в файле конфигурации.
Каталог данных не верен Убедитесь, что в корне каталога данных присутствует файл «.ocdata».
Comments
nathan99218 commented Dec 20, 2017
Hello I have been trying to research this all day and I keep getting the same error «your data directory is invalid Ensure there is a file called «.ocdata» in the root of the data directory.
The text was updated successfully, but these errors were encountered:
kyrofa commented Dec 22, 2017
Explain to me exactly what you’re trying to do. You had the snap working without any external drive, and now you want to migrate all that date to the external drive?
nathan99218 commented Dec 22, 2017
sorry if it sounded confusing. What I want to do is to be able to default all of my Nextcloud files on to an external drive instead of the internal drive on my Ubuntu machine. This previous ticket helped a lot but its still not working for me #150 (comment). I have moved and changed the data directory to the /media/externaldrive and then I get this error. «your data directory is invalid ensure there is a file called «.ocdata» in the root of the data directory.»
Thanks and sorry I’m new to this stuff.
kyrofa commented Dec 22, 2017
nathan99218 commented Dec 22, 2017
The data file is in the right place so I checked the data folder and the drive for the data file i got ls: cannot access ‘/media/woodriver/2godd/data’ : permission denied and for the external drive I got drwx—— 4 root root 4096 dec 20 14:41
kyrofa commented Dec 22, 2017
Alright, use sudo in front of those commands to ensure you don’t get permission denied. I’d like to see that as well.
nathan99218 commented Dec 22, 2017
kyrofa commented Dec 22, 2017
nathan99218 commented Dec 22, 2017
kyrofa commented Dec 22, 2017
Wait. that’s showing 2godd1 as owned by woodriver. But an earlier snippet showed that directory was owned by root. What gives?
kyrofa commented Dec 22, 2017 •
You’re switching things around. 2godd, 2godd1. I can’t help you if I’m not getting consistent information!
nathan99218 commented Dec 22, 2017
Sorry I did notice that too. I do have the data directory set as the 2godd1. I’m not sure why my external drive is showing up with 3 different names. I formatted it before I started using it.
yatzy commented Apr 28, 2020
Could it be that snap disable nextcloud should be run before changing the datadirectory in config.php?
yatzy commented Apr 28, 2020
`Access through untrusted domain
Please contact your administrator. If you are an administrator, edit the «trusted_domains» setting in config/config.php like the example in config.sample.php.
Further information how to configure this can be found in the documentation.`
From wan the site could not be found.
nextcloud.occ config:system:get trusted_domains returns right domains.
yatzy commented Apr 28, 2020
Ok now after a moment access though domain works fine, from local ip I still get «Access through untrusted domain»
slomo-official commented May 4, 2020
yatzy commented May 7, 2020
Thanks slomo-official for the suggestion! Unfortunately that did not help in my case.
wabuMike commented May 12, 2020 •
talski commented Aug 19, 2020
make sure the mount point is also owned by root (/media/mymountingpoint), mine was owned by my current user, changed to root and everything was working again
Quazmoz commented Aug 19, 2020
make sure the mount point is also owned by root (/media/mymountingpoint), mine was owned by my current user, changed to root and everything was working again
Thank you for this suggestion! It didn’t work for me however it led me to change the owner to www-data and it is working now
71ae commented Jan 9, 2021
I have installed Ubuntu 20.04 with Snap.
the file autoconfig.php is reverted back to its recent version after a couple of seconds, and the config doesn’t come into effect.
jayhendren commented Jan 13, 2021
I ran into this same error message, after following the aforementioned instructions in the wiki to the letter, also using the Nextcloud Snap on Ubuntu.
It turns out there was a symlink in my data directory path in config.php. Apparently Nextcloud did not appreciate that. I used the full path instead and that resolved the issue.
@71ae the instructions state to edit config.php, not autoconfig.php.
RodrigoBDutra commented Oct 26, 2021
for you moving the data location do you need mount the external drive in some place.
the steps I use was.
in the terminal use
— find the drive you want to mount
create a mount point, for exemple;
sudo mount /mnt/exemple
I use ext4 partition for my drive
this is the command
this will be mount temporarilly the drives.
If you want mount permanentlly use this commands
First you need find the UUID from your drive
use
you will find all drives and UUID of each one, choose the drive you want to mount and copy the UUID from it.
after that you need input some informations in fstab
to do it first create a bkp from fstab (I had loads of headache before realize to do this)
this commmand create a backup
sudo cp /etc/fstab /etc/fstab.bkp
after you need write some lines in the file
sudo nano /etc/fstab
don’t change anything inside this file just add this line (get the line as the same format f you drive)
FAT | UUID=FC05-DF26 /mnt/exemple vfat defaults,auto,users,rw,nofail,umask=000 0 0
NTFS | UUID=FC05-DF26 /mnt/exemple ntfs defaults,auto,users,rw,nofail,umask=000 0 0
exFAT | UUID=FC05-DF26 /mnt/exemple exfat defaults,auto,users,rw,nofail 0 0
EXT4 | UUID=FC05-DF26 /mnt/exemple ext4 defaults,auto,users,rw,nofail 0 0
Don’t forget to set the corresponding UUID and replace the mount point with the one you have created (if it is not /mnt/exemple).
Mertviyprorok.com
Сайт Мертвого Пророка — Стримы, Новости IT и Game индустрии
Боковая колонка
Рубрики
Свежие записи
Свежие комментарии
Боковая колонка
Метки
Как изменить расположение папки data в Nextcloud snap
Если вы хотите изменить расположение папки data в Nextcloud snap, это папка, в которой хранятся данные, то для этого есть два способа.
1 способ до того как вы создали учетную администратора и 2 способ после того как вы создали учетную администратора.
Содержание
1 способ
Рекомендации к 1 способу
В документации папку data рекомендуется монтировать в каталог /media/ или /mnt/.
Но на деле сменить хранилище фалов удалось только когда я расположил его в папке /mnt/.
В каталоге /media/ выдает ошибку: Ошибка Невозможно создать или записать в каталог данных /media/nextcloud/data.
Так же я пробовал указать расположение в каталоге /home.
Интересно, что nextcloud не выдал ошибку как при размещении в каталог /media/, а завершил установку, но если проверить папку где должен располагаться каталог data, то там пусто, а все файлы хранилища находятся по стандартному пути.
Перейдем к смене каталога.
Создаем папку
Создаем папку, в которой у нас будет хранилище файлов, по пути /mnt/nextcloud/data:
Меняем пользователя и группу
Меняем пользователя и группу каталога на root:
Назначаем права
Назначаем права 0770 на каталог /mnt/nextcloud/data:
Обновляем конфигурацию Nextcloud
Открываем для редактирования конфиг /var/snap/nextcloud/current/nextcloud/config/autoconfig.php:
Находим там строчку ‘directory’ => getenv(‘NEXTCLOUD_DATA_DIR’), и меняем ее на
Заходим через веб Nextcloud и дальше как обычно создаем пользователя администратора и дожидаемся окончания установки.
Если до изменений конфига вы зашли на веб страницу вашего Nextcloud, не забудьте обновить ее после изменений конфига перед тем как создавать пользователя.
2 Способ
Рекомендации к 2 способу
Тут, я так понимаю, можно монтировать в любой каталог.
Но и здесь тоже есть проблемы с каталогом /media/.
Ошибка Убедитесь, что в корне каталога данных присутствует файл «.ocdata».
Хотя файл на месте и все права назначены.
Если монтировать в каталог /mnt/ и /home/, то все прекрасно работает.
Создаем папку
Создаем папку, в которой у нас будет хранилице файлов, по пути /mnt/nextcloud:
Обновляем конфигурацию Nextcloud
Открываем для редактирования конфиг /var/snap/nextcloud/current/nextcloud/config/config.php:
Находим там строчку ‘datadirectory’ => ‘/var/snap/nextcloud/common/nextcloud/data’, и меняем ее на
Отключаем Nextcloud
Для отключения nextcloud вводим в терминал:
Переносим каталог с данными
Переносим каталог с данными data:
Запускаем Nextcloud
Для запуска Nextcloud вводим в терминал:
Каталог с данными перенесен.
Видео Как изменить расположение папки data в Nextcloud snap
Как изменить расположение папки data в Nextcloud snap: 1 комментарий
Добрый вечер!
Опубликуйте пожалуйста, я нашел почему нельзя располагать дату на внешних носителях! Все оказалось проще, для того чтоб это сделать надо было всего-то дать доступ snap во внешние хранилища. Все решается командой ниже:
sudo snap connect nextcloud:removable-media
Спасибо за статью!
A random blog from a sysadmin
Please check that the data directory contains a file “.ocdata” in its root
ownCloud 9 on Raspberry Pi 2 with mounted Buffalo NAS
The Linux nerd inside me was screaming for a new RPi project. What to build? What to do? You can’t read any modern IT literature nowadays without stumbling upon the word “cloud”. Well, cloud it is. Owncloud in my case. I guess almost everyone is familiar with this open source cloud software, but for those of you that aren’t you can find information at:
The idea was to access my trusty old Buffalo NAS remotely, without having the need to map network drives etc. Buffalo is actually offering some sort of cloud solution also, but hey, it’s much more fun configuring your own stuff 🙂 The idea is quite simple – The RPi is a front-end for the NAS. Clients are connecting to the RPi, which in turn mount network storage from the NAS. Here’s the setup:
Fig 1. RPi + Buffalo NAS
Initial questions and ideas
I actually decided to go with option 2, not visible on the Internet. My decision is based on the fact that I’m already running a VPN server. It’s one more extra step before getting/synchronizing the files, but I think it’s worth it in the end. Besides, all my other services are behind VPN also.
That said, I STILL configured ownCloud to be “future-proof” even if the server won’t be Internet-facing (with port forwarding etc.) right now. (See the securing ownCloud chapter). Better safe than sorry 🙂
Installation
Securing ownCloud
Owncloud’s own Security & setup warnings will warn you about things to fix. Here’s a screenshot with almost no security measurements taken. (Actual screenshot is not mine, it’s “borrowed” from the Internet):
Fig 2. Before fixing Security & Setup warnings. I’ll write about memory cache in the next chapter (Optimizing ownCloud).
… and here’s a screenshot with fixed security (also memcached fixed):
Fig 3. No security & setup warnings 🙂
Basic security
The initial setup guide I followed had already done some basic security measurements (luckily):
server <
listen 443 ssl;
add_header Strict-Transport-Security “max-age=15768000; includeSubDomains; preload”;
More information about security can be found in ownClouds own Hardening and Security Guidance:
Advanced security
If you are going to deploy a server that’s facing the Internet you have to think about security. The basic security measurements are a must, but what if you want to secure it even more? You certainly want your site protected against DDOS and brute-force attacks, don’t you? Well, here’s where one of my favorites come into play – fail2ban. If you have no idea what I’m talking about I suggest that you read at least the following:
Ошибка 403
Вы столкнулись с сообщением «Ошибка 403»? Что делать, мы расскажем в этой статье.
Если при открытии вашего сайта вы получили одно из следующих уведомлений:
Ошибка 403 говорит о том, что доступ к запрашиваемой странице запрещён или у пользователя нет прав на просмотр контента.
Причинами такой ошибки, чаще всего, являются неправильные настройки сайта, которые может решить только создатель ресурса. Со стороны пользователя также бывают проблемы, но они случаются намного реже.
Возможные причины и их решения, если проблема на стороне владельца сайта
Заблокирована работа хостинга
403 ошибка может возникнуть, если услуга хостинга была заблокирована. Блокировка может произойти, если превышены технические ограничения тарифа или нарушены условия договора оферты. Перед блокировкой на контактный email владельца услуги придёт предупреждение. У него будет 24 часа на устранение причины блокировки.
Проверьте вашу электронную почту. Если вам приходило уведомление о блокировке, следуйте рекомендациям в письме. После снятия блокировки сайт будет доступен. Если вы пропустили такое сообщение или не устранили проблему вовремя, услуга блокируется. Для снятия блокировки следуйте инструкции в письме или обратитесь в техническую поддержку.
Если подобных писем не приходило и услуга не блокировалась, причина ошибки в другом.
Некорректно задана главная страница сайта
Главная страница сайта (индексный файл) – это первая страница, которая открывается пользователю, если он перешёл по домену без указания точной страницы сайта, например www.test.ru. По общепринятым правилам она называется index.html или index.php. Если в корневой папке сайта отсутствует файл с названием index.html или index.php, возникнет ошибка 403. В качестве индексного файла может использоваться файл, отличный от index.html или index.php. Но название данного файла должно быть указано в настройках.
Чтобы это проверить войдите в панель управления хостингом и следуйте соответствующей инструкции ниже: