Forums | Mahara Community
Support
/
Can Mahara stop working after a change of domain?
08 May 2009, 5:45
Hello,
We have changed recently the domain of our Mahara site in our college (and by that I mean the IP address). The IT technician who did this change assured that the old domain will point to the new one, and I have checked that this is right. Our Mahara site is in the same server, same configuration, etc.
Everything is working fine in Mahara, but I have discovered that when you try to add new content to a view, there is a message saying "Loading" on top of the browser (all kind of browsers) and nothing else happens, it just gets stuck there. Likewise, when I try to delete content (any block type) which was already added to the view, I get the following error message:
"
Mahara: Invalid Parameter
A required parameter is missing or malformed".
I cannot believe that a change of domain can caused this. However, when I check the source code of the browser, all the links refer to the old domain.
For instance, in the forms:
"
<form action="http://mahara.mis.carnegiecollege.ac.uk/view/" method="GET">"Is this normal? Is there any configuration file I need to change appart form config.php?
Thank you very much.
Edits to this post:
- Account deleted 08 May 2009, 20:48
08 May 2009, 20:51
Hi (I edited your post to make all the text display)
So, does this mean that your site has actually changed hostname and ip address? And your technician has redirected the old hostname to the new one?
If that is the case, then I imagine the 'wwwroot' setting in the database is wrong, and needs to be fixed. It will still be refering to the old hostname. So you need to go into the database and run a query like:
UPDATE config SET value = '[newhostname]' WHERE field = 'wwwroot';
You'll always need to do that, even if you set it in config.php. If you set it in config.php, make sure you change it there too.
11 May 2009, 3:19
Hi Nigel,
Yes, it was as we suspected: the old hostname was not properly directed to the new one. It is fixed now.
Thank you very much.
30 May 2009, 8:01
Sometimes it is useful not to use a fixed base url.
I would like to be able to access a site using more than one base URL - two (sub-) domains, maybe using SSL access and unencrypted access. Unfortunately this is disabled by the hard coding of the base url into various places in the database, not just wwwroot (i checked the database dump of a 1.07 site).
Therefore i would appreciate a mechanism like the one used in drupal to handle this situation if needed. Drupal can use the following php snippet to achieve this:
$base_url = 'http' . (isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] == 'on' ?
's' : '' : '');
$base_url .= '://' .$_SERVER['HTTP_HOST'];
if ($dir = trim(dirname($_SERVER['SCRIPT_NAME']), '\,/')) {
$base_url .= "/$dir";
}
Is it possible to remove the hard coding of the base url in a future release of mahara? BTW - is it possible tu use just the "/" in wwwroot?
THX
Beate
31 May 2009, 10:57
A quick reply on my previous question. Although i did not completely test it (in Mahara 1.13 German), it appears to be possible to run a single mahara installation on multiple domain names by simply setting
$cfg->wwwroot = '/';
in config.php. AFAIK there is no need to touch the database as suggested by Nigel.
Beate
01 June 2009, 16:38
And this will totally break Moodle networking
That's the main reason why Mahara insists on running at one base URL.
If you want more than one, more often than not what you can actually accept is having multiple wwwroots redirecting to one of them. That also makes it more likely your users will get HTTP cache hits and that they won't have cookie problems too.
The installation instructions explain how you can do this.
01 June 2009, 18:12
Nigel, thx for the reply,
breaking moodle is indeed a strong argument. On the other hand there are (and probably will be) applications of mahara where this is not important. Then it might be nice to have more flexibility.
One situation might be a server located in a LAN behind a NAT router which shall be reachable from the outside. Then You NEED domain independence - redirection is not possible (this is the case for one of my sites running drupal).
Anyway: setting wwwroot to / will break the registration links sent by email since wwwroot is being used to construct this link. The following code, however, will work. I tested the registration procedure as well as downloads.
$cfg->wwwroot = 'http'
. (isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] == 'on' ? 's' : '' : '');
$cfg->wwwroot .= '://' .$_SERVER['HTTP_HOST'] .'/';
I would greatly appreciate if this freedom either and preferably to use a hard coded base url or a computed one was left in mahara in future releases. I wouldn't mind if this would be something like 'unofficial, unsupported but known to work'
Beate
PS: the improved performance of 1.13 with respect to 1.07 is great. Thx for that effort.