[Error] htaccess not working

Hello,

I just installed nextcloud on my server. Everything is fine except for the error in my admin page:

Your data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.

I checked everything and mod rewrite is working and everything seems to be set correctly in my virtual host file: <IfModule mod_ssl.c><VirtualHost *:443> DocumentRoot "/var/www/nextcloud" - Pastebin.com

Can anyone tell me how to fix my problem?

Im running Ubuntu 16.04, Apache 2.4.18, PHP7 and MariaDB.

Is there a .htaccess file in your data-directory? Are the permissions correctly set (webserver needs to read it)?

You can also deny access in your apache-config:

<Directory /var/www/nextcloud/data>
Require all denied
</Directory>

Hi

Please Check that link: yourdomain.com
→ should be an error 403

example for .htaccess in data/ directory:

Premission: -rw-r–r-- root:www-data .htaccess
chmod 0644 .htaccess

Hope that can help

Here is that image as text to save people from having to type it out:

# line below if for Apache 2.4
<ifModule mod_authz_core.c>
Require all denied
</ifModule>

# line below if for Apache 2.2
<ifModule !mod_authz_core.c>
deny from all
Satisfy All
</ifModule>

# section for Apache 2.2 and 2.4
IndexIgnore *
1 Like