files accessible from Internet - .htaccess not working

Ask all your questions regarding OC 8.2 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
yajrendrag
Newbie
Posts: 2
Joined: Tue Jan 05, 2016 9:27 am
ownCloud version: 8.2.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.9

files accessible from Internet - .htaccess not working

Postby yajrendrag » Tue Jan 05, 2016 9:51 am

i have the warning message in the admin screen that my .htaccess may not be working...

however, my files really are accessible from the internet..

https://<my server>/data/[user]/files/some-file-name is displayed in the browser.

but if i simply do https://<my server>/data/[user]/files/ - this produces the expected Forbidden message. so only when i try and access actual files below any folders does it work.

i've looked through the forums - i do not have any htaccesstest.txt files; i have run the strong permissions; my data directory is in the standard location (however, i do also have external storage set up in addition to the main data location - it is setup via the admin GUI). I have changed all of the AllowOveride None to AllowOveride All in the various apache2 conf files.

How can I prevent /<my server>/data/[user]/files/some-file-name from being accessed?

How can i also check my external storage to ensure it is not exposed?

ubuntu 14.04
Owncloud 8.2.2
Apache 2.4.7
PHP 5.5.9
MySQL database - version 5.5

thx, Jay

rakekniven
Inventory
Posts: 2019
Joined: Sun May 06, 2012 3:31 pm
ownCloud version: 9.0.1
Webserver: Apache
Database: MySQL
OS: Linux Hosting Package
PHP version: 5.6.x
Contact:

Re: files accessible from Internet - .htaccess not working

Postby rakekniven » Tue Jan 05, 2016 2:53 pm

Your issue is basically an apache issue.
Please check internet on how to configure apache to have htaccess files working.
ownCloud is not only about files. There is so much more. Explore the apps to extend your ownCloud.

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: files accessible from Internet - .htaccess not working

Postby RandolphCarter » Tue Jan 05, 2016 3:11 pm

Typically this results from the apache config preventing the reconfiguration via .htaccess (so either .htaccess are not configured to be used as apache config, or root configuration prevents it to become active).

i do not have any htaccesstest.txt files

That is normal, this file gets created and removed again during the accessibility check.
have changed all of the AllowOveride None to AllowOveride All in the various apache2 conf files.

Have you checked e.g. via grep that you haven't missed one? Have you restarted apache after the change?

If all else fails: As a workaround, you could change your data directory to a location outside of your document root.

How can i also check my external storage to ensure it is not exposed?

External storage is not accessible in this way and therefore is not endangered of being exposed.

yajrendrag
Newbie
Posts: 2
Joined: Tue Jan 05, 2016 9:27 am
ownCloud version: 8.2.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.9

Re: files accessible from Internet - .htaccess not working

Postby yajrendrag » Tue Jan 05, 2016 5:53 pm

thanks.

ended up having to move owncloud directory - i couldn't make htaccess work.

amc2002
Newbie
Posts: 9
Joined: Thu Apr 02, 2015 8:05 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.4

Re: files accessible from Internet - .htaccess not working

Postby amc2002 » Mon Apr 18, 2016 8:34 pm

For anyone else having this issue who doesn't want to move their data directory, the following was where I made the apache change.

1) Check your apache conf file (mine is at /etc/httpd/conf/httpd.conf). You'll notice there are one or more <Directory> entries that probably say AllowOverride None. For instance, you probably have one for the general /var/www folder (and maybe one for /var/www/html as well):

<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>

2) What I did was just copy that and add a directory entry for the ownCloud directory allowing overrides (which also recursively allows overrides):

<Directory "/var/www/html/owncloud">
AllowOverride All
# Allow open access:
Require all granted
</Directory>

Result: /var/www/html/owncloud/data/.htaccess is now allowed through recursion (as would an .htaccess file found in any directory under /var/www/html/owncloud).

This fixed the issue for me, as I didn't want to move my data directory (especially given the github post referenced in the instructions for moving the data directory). Hope this helps others.

vivithemage
Newbie
Posts: 5
Joined: Tue Aug 25, 2015 9:39 pm
ownCloud version: 8.1.1
Webserver: Apache
OS: Linux

Re: files accessible from Internet - .htaccess not working

Postby vivithemage » Tue Jul 05, 2016 10:52 pm

Yeah AMC is right, that also resolved it for me...running apache 2.4.6


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 8.2”

Who is online

Users browsing this forum: No registered users and 1 guest