System Message "Your data directory is accessible from the internet" only with using a subdomain

Hello,

this is my first post, so sorry if I use the wrong category. I try the forum, because I didn’t find a solution for my problem after searching for hours…


Nextcloud version: 12.0.2
Operating system and version: Ubuntu 16.04
Apache or nginx version: Apache 2.4.25
PHP version: 7
Is this the first time you’ve seen this error?: no

Can you reliably replicate it? (If so, please outline steps): yes

The issue you are facing:

  1. If I open the administration panal with app. domain. com I get the message: “Your data directory and your files are probably accessible from the internet. The .htaccess file that ownCloud provides is not working. We strongly suggest that you configure your webserver in a way that the data directory is no longer accessible or you move the data directory outside the webserver document root.”
  2. If I open the administration panal with domain. com/app I get the message, that everything is all right.

The whole story:
A few months ago I checked my installation with the alias url with scan.nextcloud.com and got a A Rating. So I added a subdomain. But no matter what I do, I get this message above, if I open the administration panal with subdomain.

So has anybody an idea what to do?

Thx a lot!
Sebastian

The output of your config.php file:

How does your Nextcloud vhost looks like? Could it be that AllowOverride All (thus the usage of .htaccess) is only valid for the subdomain and that just you default ssl vhost (without AllowOverride) is active if you open nextcloud via subfolder url?
Just an idea since I don’t use a subdomain and don’t know how things are handled in that case.

€: Ah the other way round: AllowOverride All not present in subdomain vhost…

Hi Micha,

thx for your answer. I need support to answer your question :wink: I also think, that this could be the reason, but I don’t know where to configure the AllowOverride All for app.domain.com… there are a lot of .conf files, but I don’t know which one to change…

Thx and Sry for my “simple” questions…

Sebastian

I would try to disable old *.conf files you are not using any more…

You can try to access directly the datafolder and see if it works:
https://example.org/nextcloud/data/username/files/file_in_root_folder.txt

Thx all for your answers. Now I have an idea how to solve it.

Here the admin manual to this: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-web-server-configuration

I would place the AllowOverride All just inside the <Directory> directive as intended there.