.htaccess file not working with AllowOverride All

Hello,

I just installed nextcloud 13.0.0 on a fresh Ubuntu 16.04.4 LTS.

Nextcloud 13.0.0
Ubuntu 16.04.4 LTS
Apache 2.4.18
PHP 7.0.25-0ubuntu0.16.04.1 (cli)

I get the following Error

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.

My nextcloud.conf in apache2\sites-available


<VirtualHost *:80>
  ServerName cloud.domain.com
  <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [R=301;L,NE]
  </IfModule>
  <IfModule !mod_rewrite.c>
    Redirect 301 / https://cloud.domain.com/
  </IfModule>
</VirtualHost>

<VirtualHost *:443>
  ServerName cloud.domain.com
  SSLEngine On
  SSLProtocol -ALL +TLSv1 +TLSv1.2
  SSLCompression Off
  SSLHonorCipherOrder On
  SSLCipherSuite ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128
  SSLVerifyDepth 10
  SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
  <IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
  </IfModule>

  DocumentRoot "/var/www/nextcloud/"

 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory /var/www/nextcloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /var/www/nextcloud
 SetEnv HTTP_HOME /var/www/nextcloud
 Satisfy Any
</Directory>
</VirtualHost>

my apache2.conf in /etc/apache2


<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>


#<Directory /srv/>
#       Options Indexes FollowSymLinks
#       AllowOverride None
#       Require all granted
#</Directory>




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
        Require all denied
</FilesMatch>


How can I fix the problem?

Thank you very much
p-4

1 Like