PermaLink Mediawiki and reverse proxy05/07/2005 01:01 AM
I was playing around with mediawiki, which is the engine powering wikipedia.de, and had some troubles to have it cooperate with my reverse proxy.

First problem was, that mediawiki was constanly redirecting my request to the apache servers port instead of staying in port 80, which is the reverse proxies port. I had to edit the file includes/DefaultSettings.php to get it work. my changes in red:
$wgServer = $wgProto.'://' . $wgServerName;
#if( isset( $_SERVER['SERVER_PORT'] ) && $_SERVER['SERVER_PORT'] != 80 ) {
#       $wgServer .= ":" . $_SERVER['SERVER_PORT'];
#}
unset($wgProto);

The second problem was, that mediawiki always used the reverse proxies IP address instead of the users IP address. My reverse proxy adds the requestors IP in a new field named HTTP_X_FORWARDED_FOR. I found some documentation here and set the parameter
$wgUseSquid = true;

That did it for me.

References:
wikipedia.de
mediawiki

1871 .
Hinweis
Das Weblog gibt meine persönlichen Ansichten und Kommentare wieder und entspricht nicht den Positionen meiner aktuellen oder früheren Arbeitgeber oder Kunden.
Über mich
Nach Kategorie
Meine Seiten
A view of that name cannot be found in the specified database
netcraft Linux host Blog Admin OpenNTF
Monatsarchiv