Nextcloud version: 29.0.1.1
The issue you are facing:
Since the upgrade to version 29, I was getting this error message in “Security & setup warnings”:
There are some errors regarding your setup.
Your data directory and files are probably accessible from the internet. The .htaccess file is not working. It is strongly recommended that you configure your web server so that the data directory is no longer accessible, or move the data directory outside the web server document root.
So I made sure that my files are not actually accessible from the internet and my webhoster confirmed that mod_env
is loaded in apache2, so the issue had to be somewhere else. This post
proposed to remove localhost
from trusted domains
in /config/config.php
and it works, the error message is gone!
BUT: is this just preventing the test to work properly or is it a true fix?
I have no idea what localhost does, but it is still part of the in the Default config.php Examples
of the latest documentation, so I suppose it is actually meant to be there?
config.php file prior to the change:
<?php
$CONFIG = array (
'passwordsalt' => 'xxxx',
'secret' => 'xxxx',
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'nextcloud.domain.com',
),
'datadirectory' => '/foo/bar/nextcloud/data',
'dbtype' => 'mysql',
'version' => '29.0.1.1',
'overwrite.cli.url' => 'http://nextcloud.domain.com',
'dbname' => 'xxxx',
'dbhost' => '127.0.0.1:xxxx',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'xxxx',
'dbpassword' => 'xxxx',
'installed' => true,
'instanceid' => 'xxxx',
'htaccess.RewriteBase' => '/',
'appstoreenabled' => true,
'logtimezone' => 'xxxx',
'memcache.local' => '\\OC\\Memcache\\APCu',
'updatechecker' => false,
'updater.release.channel' => 'stable',
'maintenance' => false,
'theme' => '',
'loglevel' => 2,
'mail_domain' => 'domain.com',
'mail_from_address' => 'nextcloud',
'mail_smtpmode' => 'smtp',
'mail_smtphost' => 'xxxx',
'mail_sendmailmode' => 'smtp',
'mail_smtpauth' => 1,
'mail_smtpname' => 'xxxx',
'mail_smtppassword' => 'xxxx',
'mail_smtpsecure' => 'ssl',
'mail_smtpport' => '465',
);