nextcloudpi icon indicating copy to clipboard operation
nextcloudpi copied to clipboard

The .htaccess file is not working.

Open LukasWerfel opened this issue 7 years ago • 6 comments

After a freshly installed ncp instance, I just deactivated HTTPS (its accessible via nginx on another server through VPN, and access to that server is HTTPS) and I get this. My files are exposed. How can I fix this?

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.

I fixed it for now by blocking that route on nginx, so I am not sure if there might be a way around this measure.

LukasWerfel avatar Jan 16 '19 09:01 LukasWerfel

nginx? NCP doesn't use nginx.

Please, use the forum for questions and provide information from sudo ncp-report

cheers

nachoparker avatar Jan 16 '19 23:01 nachoparker

@LukasWerfel I too have an nginx reverse proxy in front of the ncp apache. How did you solve this issue?

AvverbioPronome avatar Jul 23 '20 14:07 AvverbioPronome

Ok, found the issue. There is no AllowOverride All in the http virtualhost: https://github.com/nextcloud/nextcloudpi/blob/4a51c1f5e8a33e670a63c4c82f7eae7115b86980/bin/ncp/CONFIG/nc-nextcloud.sh#L175

AvverbioPronome avatar Jul 23 '20 15:07 AvverbioPronome

AllowOverride All is the default.

http://httpd.apache.org/docs/2.2/mod/core.html#AllowOverride

nachoparker avatar Jul 23 '20 22:07 nachoparker

AllowOverride All is the default.

Not on Debian: https://salsa.debian.org/apache-team/apache2/-/blob/master/debian/config-dir/apache2.conf.in#L153

AvverbioPronome avatar Jul 24 '20 00:07 AvverbioPronome

Oh I see, we do have AllowOverride All in nextcloud.conf, but if you disable HTTP->HTTPS redirection then it wouldn't apply, good catch.

nachoparker avatar Jul 25 '20 15:07 nachoparker