MediaWiki and reverse proxy

February 4, 2006

I’ve been trying to ProxyPass from a primary server to a backend (but not firewalled) machine running MediaWiki 1.5.2 with very little luck.

I finally come across the solution. backend.machine.edu is the machine hosting MediaWiki. frontend.machine.edu is the machine acting as a reverse proxy.

1. Proxy machine, httpd.conf


ProxyPass /wiki http://backend.machine.edu/wiki

2. On backend.machine.edu edit DefaultSettings.php

$wgServer = ‘http://frontend.machine.edu’;

This *shouldn’t* be necessary as this variable can also be provided in LocalSettings.php. However, I found the early stages of the request cycle were not correctly resolved to the front end machine.

3. Edit LocalSettings.php

Add the (possibly redundant) $wgServer variable

$wgServer = ‘http://frontend.machine.edu’;

I also found that the absolute image path for the Wiki Logo was not resolving correctly through the proxy. Correct this (if necessary) by setting $wgLogo. This assumes that your backend machine is not behind a firewall.

$wgLogo = “http://backend.machine.edu/images/wikilogo.jpg”;

4. Edit squid.conf on squid.machine.org to exclude wiki content

I might want to revisit this decision in the future. For now, I’d rather not fill our cache with Wiki material, saving that space for the heavier acedb content.

acl wiki url_regex -i wiki
no_cache deny wiki
Bookmark and Share

{ 5 comments… read them below or add one }

1 Cantão! April 11, 2006 at 7:35 pm

Hi!

Your solution worked for me exactly as if I had set ProxyPreserveHost On on the frontend machine.

The problem is that this solution is putting a lot of stress in the backend Apache. To simply access a page in the wiki, its usage jumps to 99%!

Do you have any hints about that? I’m on Apache 2.0.55 with PHP 4.4.2.

Cheers, Cantão!

2 proxies November 21, 2008 at 11:27 am

Your solution works great! tanks!

3 Proxy March 25, 2009 at 11:19 pm

Will this work from university where onlyport 80 and 8080 arr open ?

4 Bineet August 27, 2009 at 2:07 am

Your tips helped me a lot. I am through all my problems.

Thanks.
Regards.

5 Sitz August 31, 2009 at 10:44 pm

Mediawiki is very useful. I am using this since long time.

Leave a Comment

Previous post:

Next post: