When i enter the admin page security & setup warnings are shown (X-Content-Type-Options, X-Frame-Options). With the power of google i figured out that the problem should be the .htaccess file, so i edited the apache2.conf to:
Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory
and i also checked that the “www-data” user is the owner of the .htaccess file
nothing worked yet and the security warnings are still there…
Edit: i wrote some bullshit in the .htaccess file and after that nextcloud failed to load. so, that means the .htaccess file works, but why do i get this security warnings anyway?
VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request’s Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly. #ServerNamewww.example.com
ServerAdmin xxxxxxx@gmail.com
DocumentRoot /var/www/html
Redirect permanent "/" "https://192.168.2.100/"
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with “a2disconf”. #Include conf-available/serve-cgi-bin.conf
This is the difference between your .htaccess and mine (running Nextcloud 12.0.0). So first thing would be to update your .htaccess file and get the correct one from master: https://github.com/nextcloud/server/blob/master/.htaccess
Second, your VHOST looks strange. Did you configure your settings globally in apache.conf? Because you shouldn’t.
This is a correct VHOST for port 80:
<VirtualHost 192.168.4.111:80>
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
### YOUR SERVER ADDRESS ###
ServerAdmin daniel@domain.se
ServerName cloud.domain.se
### SETTINGS ###
DocumentRoot /var/www/nextcloud
<Directory /var/www/nextcloud>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Satisfy Any
</Directory>
<IfModule mod_dav.c>
Dav off
</IfModule>
<Directory "/var/ocdata">
# just in case if .htaccess gets disabled
Require all denied
</Directory>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</VirtualHost>
so i changed the settings in .htaccess but still security warnings…
i think i’ve posted the wrong VHOST config, this is the one from /etc/apache2/sites-available/nextcloud.conf (i hope this is what you meant, i am a total noob in LAMP server stuff…)
Alias /nextcloud "/var/www/nextcloud/"
<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
</Directory>
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15768000; preload"
</IfModule>
<IfModule mod_headers.c>
Header set Content-Security-Policy: "font-src https: data:;"
# `mod_headers` cannot match based on the content-type, however,
# the `Content-Security-Policy` response header should be send
# only for HTML documents and not for the other resources.
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset Content-Security-Policy
</FilesMatch>
</IfModule>
nope, didn’t work for me, everything is working fine (i.e. uploads, enable apps, etc.) but still these security warnings…
i am clueless where the problem is because when i modify the vhost or the .htaccess file with rubbish i get error messages, so they should be working… i hope i can avoid to reinstall the LAMP server and nextcloud -.-
Well, something is messed up with your LAMP install. Better to start fresh and don’t mess with apache.conf and only create a vhost for the specific domain/host.