Hi,
I have a problem with MediaWiki 1.15. Mediawiki is installed on server A which is an apache2 server. Accessing MediaWiki via: http://A/mediawiki works, the url is correctly redirected to http://A/mediawiki/index.php/Main_Page
Now here is the problem. Server A is externally accessible via http://www.somedomain.com/somefolder/
Now when I try to access the wiki from the outside world via http://www.somedomain.com/somefolder/mediawiki/ I also get redirected to http://internal-ip-of-server-A/mediawiki/index.php/Main_Page
which will obviously not work. Accessing the page directly via http://www.somedomain.com/somefolder/mediawiki/index.php/Main_Page
loads the page but without the style, so just vanilla html style.
Is there some way to tell MediaWiki to check which url was used and that it should use this as base url?
Cheers
Philipp
Philipp Lies wrote:
Hi,
I have a problem with MediaWiki 1.15. Mediawiki is installed on server A which is an apache2 server. Accessing MediaWiki via: http://A/mediawiki works, the url is correctly redirected to http://A/mediawiki/index.php/Main_Page
Now here is the problem. Server A is externally accessible via http://www.somedomain.com/somefolder/
Now when I try to access the wiki from the outside world via http://www.somedomain.com/somefolder/mediawiki/ I also get redirected to http://internal-ip-of-server-A/mediawiki/index.php/Main_Page
which will obviously not work. Accessing the page directly via http://www.somedomain.com/somefolder/mediawiki/index.php/Main_Page
loads the page but without the style, so just vanilla html style.
Is there some way to tell MediaWiki to check which url was used and that it should use this as base url?
Cheers
Philipp
On LocalSettings.php you will have to $wgScriptPath (maybe also others that depend on it).
Platonides wrote:
Philipp Lies wrote:
Hi,
I have a problem with MediaWiki 1.15. Mediawiki is installed on server A which is an apache2 server. Accessing MediaWiki via: http://A/mediawiki works, the url is correctly redirected to http://A/mediawiki/index.php/Main_Page
Now here is the problem. Server A is externally accessible via http://www.somedomain.com/somefolder/
Now when I try to access the wiki from the outside world via http://www.somedomain.com/somefolder/mediawiki/ I also get redirected to http://internal-ip-of-server-A/mediawiki/index.php/Main_Page
which will obviously not work. Accessing the page directly via http://www.somedomain.com/somefolder/mediawiki/index.php/Main_Page
loads the page but without the style, so just vanilla html style.
Is there some way to tell MediaWiki to check which url was used and that it should use this as base url?
On LocalSettings.php you will have to $wgScriptPath (maybe also others that depend on it).
Thanks for the idea but no, thats not it. It's not the path which is wrong but the *hostname*. I enter into the browser: http://www.###.com/team1/mediawiki I get redirected to: http://192.168.0.1/mediawiki/index.php Where the web root of 192.168.0.1 (apache 2.2.14) is http://www.###.com/team1/ So the part which is before the $wgScriptPath needs to be changed (or shouldn't be changed by MediaWiki, all my other php sites work nicely) If I enter "http://www.###.com/team1/mediawiki/index.php/Main_Page" I get the contents of the main page but no style at all.
So, where does MediaWiki read/set the part of the address which comes before $wgScriptPath?
Thanks for your help!
Philipp
Philipp Lies wrote:
On LocalSettings.php you will have to $wgScriptPath (maybe also others that depend on it).
Thanks for the idea but no, thats not it. It's not the path which is wrong but the *hostname*. I enter into the browser: http://www.###.com/team1/mediawiki I get redirected to: http://192.168.0.1/mediawiki/index.php Where the web root of 192.168.0.1 (apache 2.2.14) is http://www.###.com/team1/ So the part which is before the $wgScriptPath needs to be changed (or shouldn't be changed by MediaWiki, all my other php sites work nicely) If I enter "http://www.###.com/team1/mediawiki/index.php/Main_Page" I get the contents of the main page but no style at all.
So, where does MediaWiki read/set the part of the address which comes before $wgScriptPath?
Thanks for your help!
Philipp
That would be $wgServer, although if it's not there mediawiki will guess it. The path related variables are listed at the top of http://www.mediawiki.org/wiki/Manual:Configuration_settings
That would be $wgServer, although if it's not there mediawiki will guess it.
And unfortunately it guessed wrong.
Further, I set $wgServer in LocalSettings.php which fixed the redirecting problem for the main page but some parts of MediaWiki seem to ignore this variable. $wgServer='http://www.###.com/team1'
When I load the website and look at the source: var stylepath = "/mediawiki/skins"; var wgArticlePath = "/mediawiki/index.php/$1"; var wgScriptPath = "/mediawiki"; var wgScript = "/mediawiki/index.php"; var wgServer = "http://www.###.com/team1";
but neither the style is loaded nor the links work, they point to http://www.###.com/mediawiki/. Why?
If I set $wgStylePath, $wgArticlePath, and $wgLogo to the absolute path in LocalSettings.php then Style, Logo and "index.php/Some_Page" links work, but links like "index.php?title=Special:UserLogin" again point to http://www.###.com/mediawiki/ instead of http://www.###.com/team1/mediawiki/ Why?
I cannot alter $wgScriptPath to "/team1/mediawiki" and $wgServer to "http://www.###.com" as this will break the system: "The page isn't redirecting properly"
Cheers
Philipp
Good Morning MediaWiki Fans:
We have copied our wiki system to a new machine for a hardware upgrade. It appears to work pretty much OK except for one little glitch. A login appears to function, the appropriate headers change on the page indicating your user name, but then, at the next click on anything the system believes you are coming from a non-login state. It appears to have lost track of the login state. Is there any identifier in the system that would be dependent upon the host name ? While we are testing the copy the machine has a different host name than usual. I don't notice any host name dependencies in any configuration file.
Thanks for your assistance,
--Hiram
Hiram Clawson wrote:
Good Morning MediaWiki Fans:
We have copied our wiki system to a new machine for a hardware upgrade. It appears to work pretty much OK except for one little glitch. A login appears to function, the appropriate headers change on the page indicating your user name, but then, at the next click on anything the system believes you are coming from a non-login state. It appears to have lost track of the login state. Is there any identifier in the system that would be dependent upon the host name ? While we are testing the copy the machine has a different host name than usual. I don't notice any host name dependencies in any configuration file.
Thanks for your assistance,
--Hiram
Check that php is able to save the session files. session.save_path must point to a writable directory. http://www.php.net/manual/en/session.configuration.php#ini.session.save-path
Platonides wrote:
Check that php is able to save the session files. session.save_path must point to a writable directory. http://www.php.net/manual/en/session.configuration.php#ini.session.save-path
Thanks for the hint. This is exactly what the problem was. The session save_path directory did not exist on the new machine.
We also discovered that an upgrade of PHP from v5.0.4 to v5.1.6 required a change in LocalSettings of memory_limit from 20M to 80M:
# If PHP's memory limit is very low, some operations may fail. ini_set( 'memory_limit', '80M' );
This may be due to changing from a 32-bit machine to a 64-bit machine where they php system uses more memory for page construction.
--Hiram
Philipp Lies wrote:
That would be $wgServer, although if it's not there mediawiki will guess it.
And unfortunately it guessed wrong.
Further, I set $wgServer in LocalSettings.php which fixed the redirecting problem for the main page but some parts of MediaWiki seem to ignore this variable. $wgServer='http://www.###.com/team1'
When I load the website and look at the source: var stylepath = "/mediawiki/skins"; var wgArticlePath = "/mediawiki/index.php/$1"; var wgScriptPath = "/mediawiki"; var wgScript = "/mediawiki/index.php"; var wgServer = "http://www.###.com/team1";
Don't embed the path in the server name. $wgServer='http://www.###.com'; $wgScriptPath='/team1/mediawiki';
but neither the style is loaded nor the links work, they point to http://www.###.com/mediawiki/. Why?
It's using root relative urls.
I cannot alter $wgScriptPath to "/team1/mediawiki" and $wgServer to "http://www.###.com" as this will break the system: "The page isn't redirecting properly"
What is it redirecting to? You should try to fix this last error. Seems that mediawiki is seeing itself in a different path.
Platonides wrote:
Don't embed the path in the server name. $wgServer='http://www.###.com'; $wgScriptPath='/team1/mediawiki';
The problem is: The root of my webserver is $wgServer='http://www.###.com/team1'; so /var/www of my apache is http://www.###.com/team1 MediaWikis path relative to the apache root is /mediawiki Therefor $wgScriptPath='/team1/mediawiki'; is wrong and would lead to a crash if I would access the wiki via http://localservername/mediawiki
but neither the style is loaded nor the links work, they point to http://www.###.com/mediawiki/. Why?
It's using root relative urls.
Right. But my root is http://www.###.com/team1 not http://www.###.com/, that's a different webserver.
I cannot alter $wgScriptPath to "/team1/mediawiki" and $wgServer to "http://www.###.com" as this will break the system: "The page isn't redirecting properly"
What is it redirecting to? You should try to fix this last error. Seems that mediawiki is seeing itself in a different path.
see above. The problem seems that mediawiki's root location wrt the apache is not the root wrt the webadress. That screws it up. Addressing mediawiki directly on the apache server works correct.
Cheers
Phil
Philipp Lies wrote:
Platonides wrote:
Don't embed the path in the server name. $wgServer='http://www.###.com'; $wgScriptPath='/team1/mediawiki';
The problem is: The root of my webserver is $wgServer='http://www.###.com/team1'; so /var/www of my apache is http://www.###.com/team1 MediaWikis path relative to the apache root is /mediawiki Therefor $wgScriptPath='/team1/mediawiki'; is wrong and would lead to a crash if I would access the wiki via http://localservername/mediawiki
but neither the style is loaded nor the links work, they point to http://www.###.com/mediawiki/. Why?
It's using root relative urls.
Right. But my root is http://www.###.com/team1 not http://www.###.com/, that's a different webserver.
I cannot alter $wgScriptPath to "/team1/mediawiki" and $wgServer to "http://www.###.com" as this will break the system: "The page isn't redirecting properly"
What is it redirecting to? You should try to fix this last error. Seems that mediawiki is seeing itself in a different path.
see above. The problem seems that mediawiki's root location wrt the apache is not the root wrt the webadress. That screws it up. Addressing mediawiki directly on the apache server works correct.
Cheers
Phil
The *Path variables deal with what is seen from the outside. They are not used for accessing the filesystem.
When you say a different webserver, do you mean that it is on a different machine or just that you can't change the webroot? Your webserver should handle all of that, so the webapps know which is their location.
When you say a different webserver, do you mean that it is on a different machine or just that you can't change the webroot? Your webserver should handle all of that, so the webapps know which is their location.
They are physically different machines. http://www.###.com/team1 is my local webserver A http://www.###.com/ is a webserver standing in some other building where I have no access at all
The *Path variables deal with what is seen from the outside. They are not used for accessing the filesystem.
But since A:/var/www/ == http://A/ == http://www.###.com/team1 and MediaWiki is located at /var/www/mediawiki, what is the correct $wgScriptPath? $wgScriptPath='/team1/mediawiki' would lead to http://A/team1/mediawiki which is wrong.
Thanks for your help!
Philipp
Philipp Lies wrote:
When you say a different webserver, do you mean that it is on a different machine or just that you can't change the webroot? Your webserver should handle all of that, so the webapps know which is their location.
They are physically different machines. http://www.###.com/team1 is my local webserver A http://www.###.com/ is a webserver standing in some other building where I have no access at all
A strange setup. Is http://www.###.com/ proxying to your computer?
Maybe you could request that instead of querying http://www.###.com/team1/A as http://localcomputer/A request http://localcomputer/team1/A
Or maybe ### admins know how to setup your webserver so that it passes the right variables to the application. Pretty much every app checking the variables the server tolds it will be wrong. Including even error pages, if they contain the requested path.
mediawiki-l@lists.wikimedia.org