Hi,
I am trying to run mediawiki (v1.4.0) behind a reverse proxy. The reverse proxy is set up with Apache2 mod_proxy module.
The problem is now, that mediawiki is using an absolute path in href links, which I can't handle with mod_proxy.
Example of a mediawiki link in HTML-Source: <a href="/mediawiki/index.php/Special:Recentchanges" .....>
My $wgScriptPath is set to "/mediawiki". My mod_proxy config looks like: ------------------------------------ ProxyPass /app1/ http://192.168.1.1/ ProxyPass /app1 http://192.168.1.1 <Location /app1/> ProxyPassReverse / </Location> <Location /mediawiki/> ProxyPassReverse /app1 </Location> ------------------------------------ Note: The Location directive is an alternative of "ProxyPassReverse /app1/ http://192.168.1.1/", see http://www.apacheweek.com/features/reverseproxies.
When I access http://www.myproxy.com/app1/, the mediawiki pages are loaded well. The Browser URL is set to http://www.myproxy.com/app1/mediawiki/index.php/Main_Page. Fine. But all links in the nagigation box are pointing to e.g. http://www.myproxy.com/mediawiki/index.php/Special:Recentchanges. The "/app1" is missing here, so the navigation links fail. This is because mediawiki sends always an abolute href path back.
I have tried to set $wgScriptPath to "./mediawiki", "mediawiki" or "../../mediawiki". But that didn't work.
Has anybody experiences with running mod_proxy towards mediawiki ? How can I set mediawiki to use relative links in HTML sources ? Any other suggestions ?
Thanks in advance Ralf
ralf-buero@kruedewagen.de wrote:
I am trying to run mediawiki (v1.4.0) behind a reverse proxy. The reverse proxy is set up with Apache2 mod_proxy module.
<snip>
I would firstly upgrade MediaWiki to 1.4.9 (or lastest stable) http://www.mediawiki.org/
Ashar Voultoiz wrote:
ralf-buero@kruedewagen.de wrote:
I am trying to run mediawiki (v1.4.0) behind a reverse proxy. The reverse proxy is set up with Apache2 mod_proxy module.
<snip>
I would firstly upgrade MediaWiki to 1.4.9 (or lastest stable) http://www.mediawiki.org/
Once you've done that, you'll want to be sure you properly set: $wgServer $wgScriptPath $wgArticlePath
(and anything else appropriate for customization).
-- brion vibber (brion @ pobox.com)
I have updated to 1.4.9, but nothing changed. Why should 1.4.9 behave different in terms of absolute/relative links ?
Concerning $wgServer, $wgScriptPath and $wgArticlePath I have no real clue on how to change them to fix my problem.
I could set $wgServer to the reverse Proxy URL like "http://www.myproxy.com", but then I can only access my mediawiki through the proxy, but not from other interfaces.
I have currently set $wgServer ="", since mod_proxy works the best for me without IP address or FQDN in the redirect link.
$wgScriptPath is still on "/mediawiki". The big question is: How can I set $wgScriptPath to have relative links ?
Cheers Ralf
On Friday 16 September 2005 02:34, Brion Vibber wrote:
Ashar Voultoiz wrote:
ralf-buero@kruedewagen.de wrote:
I am trying to run mediawiki (v1.4.0) behind a reverse proxy. The reverse proxy is set up with Apache2 mod_proxy module.
<snip>
I would firstly upgrade MediaWiki to 1.4.9 (or lastest stable) http://www.mediawiki.org/
Once you've done that, you'll want to be sure you properly set: $wgServer $wgScriptPath $wgArticlePath
(and anything else appropriate for customization).
-- brion vibber (brion @ pobox.com)
ralf-buero@kruedewagen.de wrote:
I have updated to 1.4.9, but nothing changed. Why should 1.4.9 behave different in terms of absolute/relative links ?
1.4.0 is ancient, buggy, and has a number of known security problems. Under no circumstances should you be running a 1.4.0 wiki in public.
Concerning $wgServer, $wgScriptPath and $wgArticlePath I have no real clue on how to change them to fix my problem.
I could set $wgServer to the reverse Proxy URL like "http://www.myproxy.com", but then I can only access my mediawiki through the proxy, but not from other interfaces.
MediaWiki is designed for internet-facing wikis which have a single well-known URL location. There is no support for changing the URL path depending on who's visiting (among other things the URLs are embedded in cached data).
-- brion vibber (brion @ pobox.com)
On Friday 16 September 2005 11:28, Brion Vibber wrote:
1.4.0 is ancient, buggy, and has a number of known security problems. Under no circumstances should you be running a 1.4.0 wiki in public.
Well, I know. My wiki is located in an intranet. I was originally planning to update to 1.5 soon.
Concerning $wgServer, $wgScriptPath and $wgArticlePath I have no real clue on how to change them to fix my problem.
I could set $wgServer to the reverse Proxy URL like "http://www.myproxy.com", but then I can only access my mediawiki through the proxy, but not from other interfaces.
MediaWiki is designed for internet-facing wikis which have a single well-known URL location. There is no support for changing the URL path depending on who's visiting (among other things the URLs are embedded in cached data).
Okay. What happens if MediaWiki is running behind a load-balancer? I guess that the servers at big sites like Wikipedia are not directly connected with their interfaces to the internet. They are behind load-balancers or something similar. Now, they should face a similar problem than me. If mediawiki sends a redirect with the URL of the local interface, the load-balancer must handle that. The browser will never see this IP address, but the address of the load-balancer.
However, I think I will focus now on a solution based on Apache module mod_proxy_html in order to remove absolute paths in links.
Thanks Ralf
ralf-buero@kruedewagen.de wrote:
On Friday 16 September 2005 11:28, Brion Vibber wrote:
MediaWiki is designed for internet-facing wikis which have a single well-known URL location. There is no support for changing the URL path depending on who's visiting (among other things the URLs are embedded in cached data).
Okay. What happens if MediaWiki is running behind a load-balancer? I guess that the servers at big sites like Wikipedia are not directly connected with their interfaces to the internet. They are behind load-balancers or something similar. Now, they should face a similar problem than me. If mediawiki sends a redirect with the URL of the local interface, the load-balancer must handle that. The browser will never see this IP address, but the address of the load-balancer.
There is a single public-facing canonical URL for a given wiki page, which all users everywhere will use. There is no one anywhere who will use a different URL.
A connection from a client will go like this:
* Url like http://en.wikipedia.org/wiki/Sandbox * Browser looks up 'en.wikipedia.org' and gets the IP address of one of our proxies * Browser sends HTTP request to the proxy * Proxy forwards HTTP request to a load balancer * Load balancer forwards HTTP request to a web server * Web server does processing, sends back data which flows back up the chain to the browser.
The same URL is passed to every point in this chain; it never changes as such. There is a mod_rewrite inside the Apache to convert form /wiki/Sandbox to /w/index.php?title=Sandbox but that's an artifact of our configuration and is in fact unnecessary (there are other ways to do the same thing without that rewrite). The hostname never changes, and there is no changing of URLs related to the proxying.
-- brion vibber (brion @ pobox.com)
mediawiki-l@lists.wikimedia.org