Trevor Sullivan wrote:
Brion Vibber wrote:
Trevor Sullivan wrote:
Hello all, I have a problem with MediaWiki running on Apache 2.0 on FreeBSD 5.2.1. Whenever I goto my server's page //server/mediawiki it always forwards me to the server's FQDN (server.pharag.biz/mediawiki/index.php) and will refuse to work otherwise. This only happens with MediaWiki and I can't seem to figure out why only MediaWiki forces the usage of the server's local FQDN. Any ideas? I can provide further information if need be. Thank you!
In a pinch, you can set $wgServer explicitly in LocalSettings.php (normally it's autodetected in DefaultSettings.php).
Thanks for the help Brian. I'm curious though...why does only MediaWiki do this, and not HL Stats or Psychostats, or phpMyAdmin (which I have all running on the same box)?
Like Brion said, MW uses the full URL, your other products use the relative url.
You could try setting $wgServer like this in LocalSettings.php:
if(isset($_SERVER["HTTP_HOST"]){ // Use the host we were accessed with $wgServer=$_SERVER["HTTP_HOST"]; } elseif(preg_match("/^192.168./",$_SERVER["REMOTE_HOST"])){ // We came from a LAN machine with IP starting 192.168 $wgServer="server"; }
Note: Using HTTP_HOST does leave your site slightly open to people spoofing URLs so you may just want to specify it using your lan IPs.
Hope that gives you some ideas.
David