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!
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!
The HTTP standard requires that redirects use a full URL (including hostname). The hostname reported by your web server is used to construct full URLs.
If your web server is misconfigured and reporting the wrong name, you should probably fix it.
In a pinch, you can set $wgServer explicitly in LocalSettings.php (normally it's autodetected in DefaultSettings.php).
-- brion vibber (brion @ pobox.com)
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!
The HTTP standard requires that redirects use a full URL (including hostname). The hostname reported by your web server is used to construct full URLs.
If your web server is misconfigured and reporting the wrong name, you should probably fix it.
In a pinch, you can set $wgServer explicitly in LocalSettings.php (normally it's autodetected in DefaultSettings.php).
-- brion vibber (brion @ pobox.com)
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
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)? And if you're accessing it externally, how do I fix this problem? I don't own the domain that I'm using for my internal network and I just want to use it with a DDNS domain. Every time you try to goto this domain however, it tries to redirect using the server's FQDN. If I change that $wgServer var in LocalSettings.php to my DDNS domain, won't this mess up trying to access the webserver internally? Thank you!
-Trevor
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
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!
The HTTP standard requires that redirects use a full URL (including hostname). The hostname reported by your web server is used to construct full URLs.
I got around this on FreeBSD 5.3 by putting the short name in /etc/hosts .
- d.
David Gerard 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!
The HTTP standard requires that redirects use a full URL (including hostname). The hostname reported by your web server is used to construct full URLs.
I got around this on FreeBSD 5.3 by putting the short name in /etc/hosts .
- d.
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
On the client machine you mean? Well yes, I did get around that by doing the similar on my windows box under c:\windows\system32\drivers\etc\hosts but that is really not preferred. I'm in this for the learning experience and would like to solve the problem that the server is having so I could implement this in a production environment if need be (may end up doing just that). Thanks for the help though! Any other ideas?? I'm racking my brain trying to figure this out, rather frusturating
-Trevor
mediawiki-l@lists.wikimedia.org