Mailing List Archive

odd network problem with installation of mediawiki
Hey folks,

I've installed Mediawiki a few times now with great success; kudos to the
folks that made the install so painless.

I'm faced with installing Mediawiki on a machine which has a slightly
strange network topology. Basically, there are two interfaces on the
machine: one answers to machine.net1.example.com and the other to
machine.net2.example.com. Computers on the net1 local subnet are blocked
from accessing the machine over the net2 interface; same goes for net2
machines trying to get to net1. Apache considers the machine.net1 address
to be canonical, so after Mediawiki installs a machine that tries to reach
the Mediawiki install from net2 has their URL redirected to the canonical
net1 address, and therefore is blocked.

What I want to know is there a reasonably simple way to get Mediawiki to
disregard the canonical address and just use
http://machine.net2.example.com/ when referred to as such? Is there a
sane and safe way to disable the redirect?

Thanks much for any information,

jf
Re: odd network problem with installation of mediawiki [ In reply to ]
On Nov 17, 2004, at 1:07 PM, John Fink wrote:
> I'm faced with installing Mediawiki on a machine which has a slightly
> strange network topology. Basically, there are two interfaces on the
> machine: one answers to machine.net1.example.com and the other to
> machine.net2.example.com. Computers on the net1 local subnet are
> blocked from accessing the machine over the net2 interface; same goes
> for net2 machines trying to get to net1.

Yuck. :) You have my sympathies.

> Apache considers the machine.net1 address
> to be canonical, so after Mediawiki installs a machine that tries to
> reach the Mediawiki install from net2 has their URL redirected to the
> canonical net1 address, and therefore is blocked.

Something like this in your LocalSettings.php should work:

if( $_SERVER['HTTP_HOST'] == 'machine.net2.example.com' ) {
$wgServer = 'http://machine.net2.example.com';
}

Note that you should not simply blindly stick the HTTP_HOST value in
$wgServer; this value is supplied by the client and could possibly be
exploited to some effect by a malicious client.

-- brion vibber (brion @ pobox.com)
Re: odd network problem with installation of mediawiki [ In reply to ]
On Wed, 17 Nov 2004, Brion Vibber wrote:

>
> Yuck. :) You have my sympathies.

Thanks. I realize it's sort of an ugly way to configure things, but I'm
stuck with it.

> Something like this in your LocalSettings.php should work:
>
> if( $_SERVER['HTTP_HOST'] == 'machine.net2.example.com' ) {
> $wgServer = 'http://machine.net2.example.com';
> }
>
> Note that you should not simply blindly stick the HTTP_HOST value in
> $wgServer; this value is supplied by the client and could possibly be
> exploited to some effect by a malicious client.
>

This totally works! Thanks much. As for malicious clients, I might be a
little worried about that but this wiki is firewalled off and protected by
.htaccess besides. Strictly internal stuff.

I hate to hit you up for more information considering how helpful you've
been already, but I notice you're the author of the importUseMod php
script included in the mediawiki distribution. I've got a UseMod wiki I'm
trying to upgrade to mediawiki, but this script says it's no longer
accurate for a UseMod upgrade. Is there a better way one can import
UseMod content into Mediawiki? Thanks much.

jf
Re: odd network problem with installation of mediawiki [ In reply to ]
Nevermind re: UseMod import. I was looking at the old script, not the new
one.

jf
Re: odd network problem with installation of mediawiki [ In reply to ]
On Nov 17, 2004, at 2:51 PM, John Fink wrote:
> This totally works! Thanks much.

Woo-hoo!

> I hate to hit you up for more information considering how helpful
> you've
> been already, but I notice you're the author of the importUseMod php
> script included in the mediawiki distribution. I've got a UseMod wiki
> I'm
> trying to upgrade to mediawiki, but this script says it's no longer
> accurate for a UseMod upgrade. Is there a better way one can import
> UseMod content into Mediawiki? Thanks much.

Make sure you're looking at the one in the maintenance directory, not
the old one in maintenance/archives. I should get rid of that one, it's
broken. :)

Also, I've just made a change which is in the CVS branch for adding
[[brackets]] to CamelCase and /Subpage links during import. I just
posted about this in response to a question on wikitech-l, check the
list archives at mail.wikipedia.org.

A couple additional notes: the generated dump doesn't include the link
tables or search index, so run refreshLinks.php and
rebuildtextindex.php after importing to update those for all pages.
Also user accounts are not imported, since UseModWiki's user system is
very different and it's not easy to map them in, but the edit
attributions are retained by name. If you want Special:Contributions to
work after recreating the accounts you'll need to run through the cur
and old tables to update the cur_user and old_user fields with the
appropriate user_id numbers.

-- brion vibber (brion @ pobox.com)