简体   繁体   中英

Use private and public IP addresses for MediaWiki access

I forced with IP addresses issue. Now I have MediaWiki server with local IP (192.168.0.13) and one public IP (33.44.55.66, just as exmaple). So, access from the inside is working. But also I'd like to organize remote access too. I've made a firewall rule on my router to redirect everything from 33.44.55.66:8080 to 192.168.0.13:80. But when I'm trying to connect from the outside, then MediaWiki is redirecting me to 192.168.0.13 address after "sign up" page. And, of course, it doesn't load anything.

My variables in LocalSettings.php now:

$wgInternalServer = "http://33.44.55.66:8080";
$wgServer = "http://192.168.0.13";

I know, InternalServer variable is mostly for Squid, but I thought it could work as a simple proxy.

Apache setting:

ServerName 33.44.55.66:8080

When I set up $wgServer = " http://33.44.55.66:8080 " - I don't have any access from the inside network.

Could you help me, please, just telling what can go wrong?

When performing some redirects, MediaWiki is using the server specified in $wgServer . And when someones view a page for the first time, the content is cached on the server and internal links may point tho the server specified in $wgServer at the time the page was cached.

What does it mean? You need to set up $wgServer to a host/domain name accessible from anywhere . You can't even put logic in that setting so it changes depending on whether your visitors come from the internal or external IP.

In an internal/external network scenario, you should put $wgServer to the external IP address, or even better: a domain name.

Your internal network should be able to access it using the external IP. If using a domain, you may set up DNS servers for your internal network pointing to the internal IP, overriding the DNS entries from the external network that would point to the external IP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM