I have a part of the answer.
mediawiki was redirecting the call to the public url to the private url.
The hostname of the linux server is the private url "smallpc.home" The public url is something like "smallpc.dyndns.org"
When the browser calls smallpc.dyndns.org/wiki, somehow mediawiki tells the browser (through apache) to redirect (status 301) the call to the private url smallpc.home/wiki
If I change the hostname of the linux server to the public url and install it again, then it works fine, either from a private or either from a public ip adress.
On Apr 11, 2005 10:19 PM, Byortek wiki wiki@byortek.com wrote:
When the browser calls smallpc.dyndns.org/wiki, somehow mediawiki tells the browser (through apache) to redirect (status 301) the call to the private url smallpc.home/wiki
Aha; I think you need to add a line in your "LocalSettings.php" file defining $wgServer; otherwise it will be automatically detected each time from the apache settings (I think). e.g.
$wgServer = "http://smallpc.dyndns.org";
[AFAICS, it will still be auto-detected in DefaultSettings.php, but this will then override it since LocalSettings.php is evaluated later.]
From: "Rowan Collins" rowan.collins@gmail.com
On Apr 11, 2005 10:19 PM, Byortek wiki wiki@byortek.com wrote:
When the browser calls smallpc.dyndns.org/wiki, somehow mediawiki tells the browser (through apache) to redirect (status 301) the call to the private url smallpc.home/wiki
Aha; I think you need to add a line in your "LocalSettings.php" file defining $wgServer; otherwise it will be automatically detected each time from the apache settings (I think). e.g.
$wgServer = "http://smallpc.dyndns.org";
It's not working if the hostname remains a private url. The final adress will be the $wgServer adress but in between the apache will redirect to the private url. So, the public client cannot access the wiki because it can't reach the in-between private adress.
I've made a test, see below.
You'll see that when the client requests the public adress (smallpc.dyndns.org), the apache server redirects it to the private adress (smallpc.home) and, on next call, redirects it to the public adress (smallpc.dyndns.org) !!!
There's two apache redirections !!
Here are the configuration and the trace dump:
-- configuration -- private url of the server: smallpc.home public url of the server: smallpc.dyndns.org apache server on port 8081 linux server hostname: smallpc.home $wgServer = "http://smallpc.dyndns.org:8081"; ------------
Here is the simplified etherreal trace dump of a private client http request: browser adress: http://smallpc.dyndns.org:8081/wiki C = Client S = Server C->S GET /wiki HTTP/1.1 Host: smallpc.dyndns.org:8081 S->C HTTP/1.1 301 Moved Permanently <blah blah> Location: http://smallpc.home:8081/wiki C->S GET /wiki HTTP/1.1 Host: smallpc.home:8081 S->C HTTP/1.1 301 Moved Permanently <blah blah> Location: http://smallpc.dyndns.org:8081/wiki/index.php/Accueil C->S GET wiki/index.php/Accueil HTTP/1.1 Host: smallpc.dyndns.org:8081 S->C <the wiki page ...> ------------
Finally it works if I set the hostname to a public adress. However I'm still concerned because I wonder how it will behave in a shared hosting environment. If I cannot change the hostname, I may not be able to host my wiki ....
Thanks for help Eric
Byortek wiki wrote:
You'll see that when the client requests the public adress (smallpc.dyndns.org), the apache server redirects it to the private adress (smallpc.home) and, on next call, redirects it to the public adress (smallpc.dyndns.org) !!!
Did you set the ServerName directive correctly in httpd.conf (or your <VirtualHost> section)?
-- brion vibber (brion @ pobox.com)
From: "Brion Vibber" brion@pobox.com
Byortek wiki wrote:
You'll see that when the client requests the public adress (smallpc.dyndns.org), the apache server redirects it to the private adress (smallpc.home) and, on next call, redirects it to the public adress (smallpc.dyndns.org) !!!
Did you set the ServerName directive correctly in httpd.conf (or your <VirtualHost> section)?
I haven't set the ServerName nor any <VirtualHost> section.
However I placed a simple test.html file in the wiki dir and apache returned that page immediately. There is not these two redirections of the wiki main page.
That's why I thought the problem was coming from mediawiki.
Regards Eric
Byortek wiki wrote:
From: "Brion Vibber" brion@pobox.com
Did you set the ServerName directive correctly in httpd.conf (or your <VirtualHost> section)?
I haven't set the ServerName nor any <VirtualHost> section.
Then Apache will probably be autodetecting your hostname (smallpc.home) and using that.
However I placed a simple test.html file in the wiki dir and apache returned that page immediately. There is not these two redirections of the wiki main page.
Well, let's look at that trace in detail:
C->S GET /wiki HTTP/1.1 Host: smallpc.dyndns.org:8081 S->C HTTP/1.1 301 Moved Permanently <blah blah> Location: http://smallpc.home:8081/wiki
MediaWiki would never send you here; this looks like something Apache would do, for instance if UseCanonicalName is on and it's detected smallpc.home as the hostname. Note that you're asking for a *directory* without the final slash; this is an action that will produce a redirect under just about any configuration.
C->S GET /wiki HTTP/1.1 Host: smallpc.home:8081 S->C HTTP/1.1 301 Moved Permanently <blah blah> Location: http://smallpc.dyndns.org:8081/wiki/index.php/Accueil
This is MediaWiki telling you to go to the main page.
C->S GET wiki/index.php/Accueil HTTP/1.1 Host: smallpc.dyndns.org:8081 S->C <the wiki page ...>
And here's the main page itself.
-- brion vibber (brion @ pobox.com)
From: "Brion Vibber" brion@pobox.com
Byortek wiki wrote:
From: "Brion Vibber" brion@pobox.com Did you set the ServerName directive correctly in httpd.conf (or your <VirtualHost> section)?
I haven't set the ServerName nor any <VirtualHost> section.
Then Apache will probably be autodetecting your hostname (smallpc.home) and using that.
Yep. Right. I set the ServerName to smallpc.dyndns.org and I'm not getting the redirection to the private URL.
It was not getting the redirection to the private URL with the test file maybe because (as you said) this redirection occurs only when requesting a *directory* without the final slash.
Thanks and sorry for the trouble Eric
wikitech-l@lists.wikimedia.org