images .htaccess file makes images inaccessible
Closed, ResolvedPublic

Description

This may just be something specific to my local instance, but I can't access anything in my images directory unless I delete the rewrite rules in images/.htaccess.

With the rewrite rules in place, any URL within my images directory results in a 500 server error. With the rewrite rules removed, everything works fine.

I'm using Apache 2.0 in MacOS 10.8.5 with MediaWiki 1.23 (current master).


Version: 1.23.0
Severity: major
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=28235

Details

Reference
bz62289
bzimport set Reference to bz62289.
bzimport added a subscriber: Unknown Object (MLST).
kaldari created this task.Mar 5 2014, 11:45 PM

It isn't only your local instance. I too had problems due to the rules in that damn .htaccess file. I was looking for a solution for over an hour until I finally just randomly checked if there was a hidden file at my images directory, and there it was. I deleted the rules and everything went back to normal. However, I wasn't getting a 500 error, but rather a 403. I'm using Apache 2.2.24, Mac 10.9 and MediaWiki 1.23.1

CCing Tim...

For reference, the current rewrite rules for images are:

<IfModule rewrite_module>
RewriteEngine On
RewriteCond %{QUERY_STRING} \.[^\\/:*?\x22<>|%]+(#|\?|$) [nocase]
RewriteRule . - [forbidden]
</IfModule>

Reedy added a comment.Jul 30 2014, 6:04 PM

WFM

Ubuntu 14.04.1
Apache 2.4.7-1ubuntu4.1
PHP 5.5.9-1ubuntu4.3

MW 1.24alpha (git master)

The common thing here would seem to be OSX

When I try to access the file directly I get...
Forbidden
You don't have permission to access /images/thumb/... on this server.

The Apache error logs say:
[warn] (2)No such file or directory: Cannot reinit SSLMutex

Looks like an Apache bug. I wonder if any RewriteRule would do it.

Tim: Looks like you're right. I tried a variety of different RewriteConds and they all result in the 500 error.

I'm currently running Apache 2.2.24 (which produces the bug). I'll try upgrading it and see if that makes any difference.

Updated to Apache 2.2.26 and still have the same problem (403 error Forbidden).

Change 176799 had a related patch set uploaded (by Kaldari):
Add FollowSymLinks option to /images .htaccess rule

https://gerrit.wikimedia.org/r/176799

Patch-For-Review

Change 176799 merged by jenkins-bot:
Add FollowSymLinks option to /images .htaccess rule

https://gerrit.wikimedia.org/r/176799

kaldari closed this task as "Resolved".Dec 5 2014, 11:49 PM
kaldari claimed this task.
Gilles moved this task from Untriaged to Done on the Multimedia board.Dec 8 2014, 1:17 PM
Ricordisamoa set Security to None.
Ricordisamoa added a subscriber: Ricordisamoa.