MediaWiki Availibility for Local and External

1

I'm currently hosting a MediaWiki site on my computer. I'm forwarding port 80 to my computer, and I'm able to access it from outside the network, as long as the $wgServer variable in LocalSettings.php is set to my external ip address. Although this works, I'm unable to view the wiki from within my local network, as any requests to [internal ip]/wikiname of my computer are redirected to the external ip's domain at [external ip]/wikiname and it won't load. I can reverse this by setting $wgServer to instead be my internal ip, but then I am unable to access the site from outside my network. Is there any way I can have it be accessible from both inside and outside of my home network?

Zach Brantmeier

Posted 2014-11-04T00:55:07.880

Reputation: 343

Answers

3

What happens if you don't set it at all? According to the documentation, if it's not set, it should be autodetected and should then work with both your internal IP and your external domain/ip.

See here for documentation.

bhavicp

Posted 2014-11-04T00:55:07.880

Reputation: 105

0

Answer from @bhavicp is correct. Also the following worked for me if you want to specify both servers:

$wgServer         = "http://example.com";  // your external ip or domain
$wgInternalServer = "http://192.168.0.70"; // your local ip address 

Sileria

Posted 2014-11-04T00:55:07.880

Reputation: 141

0

Just set $wgServer for external and $wgInternalServer for local. e.g.:

$wgServer = "http://www.my.com";
$wgInternalServer = "http://192.168.6.10:8080";

See https://www.mediawiki.org/wiki/Manual:$wgInternalServer

jasion wa

Posted 2014-11-04T00:55:07.880

Reputation: 1

0

I managed to make this work. Add your external IP address to variable $wgExternalServer = 'your external IP address';, and to variable $wgInternalServer = 'your internal IP address';

It made my MediaWiki work, hopefully will yours also.

user460472

Posted 2014-11-04T00:55:07.880

Reputation: 1

There is no settings called '$wgExternalServer', but there is '$wgInternalServer'. Thanks for your answer anyway, it led me to the correct answer which I have posted on this page. – Sileria – 2016-04-18T13:40:25.227