Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a apache proxy load balancer running. I have a domain wiki.mydomain.com registered to this lb. I am trying to make proxy redirect from wiki.mydomain.com to the backend http://192.168.1.56/mediawiki/ and below is the virtual hosting.

<VirtualHost *:80>
ServerName wiki.mydomain.com
<IfModule mod_proxy.c>

ProxyRequests Off
ProxyPreserveHost On
ProxyVia On

         <Proxy *>
                AddDefaultCharset off
                Order deny,allow
                Allow from all
         </Proxy>


ProxyPass / http://192.168.1.56/mediawiki/
ProxyPassReverse / http://192.168.1.56/mediawiki/
</IfModule>
</VirtualHost>

why ProxyPass / http://192.168.1.56/mediawiki/ doesn't work why ONLY ProxyPass /mediawiki http://192.168.1.56/mediawiki/ works which matching directory. Can't I make it work with above virtual hosting?

Once Again, how do I send all request from wiki.mydomain.com to http://192.168.1.56/mediawiki/ with ONLY mod_proxy WITHOUT using Redirect, Rewrite, Alias. I also don't want to use the virtual hosting done for mediawiki on 192.168.1.56 and so I don't want to proxypass / to virtual hosting on the backend as I have to register a domain for this backend, perhaps not required if has internal DNS server but I don't have internal dns running.

Anybody know how to do this with ProxyPass & ProxyPassReverse?. Thank you!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Can you clarify "doesn't work" - what happens when you have this config in place and try to request a page?

If I remember right, you'll need to change MediaWiki's configuration to work in the changed path, as it's very sensitive about those things. It needs to know where the root is, and right now, it's at /../ - which will certainly cause problems with resource loading.

You'll need to adjust the $wgScriptPath and $wgArticlePath config settings in LocalSettings.php, keeping in mind that this will break the communication of anything talking to the wiki server directly without using the proxy (any links, etc, pointing to /mediawiki/something). If anything does need to talk directly instead of through the proxy, then you'll need to make the paths match via both entry points.

share|improve this answer
    
I am getting error page page not found. And in the address it's changing to http://wiki.mydomain.com/mediawiki/index.php?.... Directly http://192.168.1.56/mediawiki/ is accessible and I think it changes the address location. –  user53864 Feb 8 '12 at 0:41
    
Right - it's configured to do so. See the third paragraph of the answer. –  Shane Madden Feb 8 '12 at 1:25
    
Is there any possible way having both accessing directly and also via proxy? –  user53864 Feb 8 '12 at 1:35
    
@user53864 Yes; if you can make the paths match. Is there anything else on the server that mediawiki is running on, or can you just move it from /mediawiki/ to /? –  Shane Madden Feb 8 '12 at 1:37
    
paths matching hmm.... if paths should match then no way other than doing virtual hosting on 192.168.1.56 and so I should register one more domain. Probably virtual hosting with internal domains can do instead registering domain but I should have DNS installed and running but I don't have and it's cloud servers. Yes, there are other apps also running on 192.168.1.5. Just wondering why proxypass redirect exactly like it's said with haproxy. –  user53864 Feb 8 '12 at 3:04
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.