Forums | Mahara Community

Support /
Closed Site Problem


anonymous profile picture
Account deleted
Posts: 2

06 March 2013, 10:37

Installing Mahara 1.6.3 does not provide a .htaccess file in the main site directory. Release notes indicate that this file was removed in version 1.4.

When on the administration page an administrator can select a red Close button in a box marked Close Site how does it work? When I did the the site went 'blank', and the browser was no longer able to find the homepage.

How does Mahara 1.6 close the site to restrict access to administrators only? How does an administrator logon once they have closed the site?

How does an admistrator re-open a closed site? Cannot find any mention of this is the manual ... all advice gratefully received.

Aaron Wells's profile picture
Posts: 896

07 March 2013, 14:08

Hi Simon,

Here's the manual page about the "Closed Site" button: http://manual.mahara.org/en/1.6/administration/overview.html#close-site

What it does is:

  • logs all non-admin users out of the site
  • displays a red banner on the top of each page reading "The site is temporarily closed for a database upgrade. Site administrators may log in."
  • Administrators can still log in and navigate around the site
  • It goes away when you go to the Admin Home screen and click the "Reopen site" button, or when you complete a database upgrade.

If you're able to access the screen with the "Close site" button on it, it means you're logged in as an administrator, in which case you should be able to log in even when the site is closed, and access the page to reopen the site.

Cheers,
Aaron

Aaron Wells's profile picture
Posts: 896

07 March 2013, 14:09

If you can't log in as an admin even when the site is closed, you could overwrite the closed site setting by updating the "siteclosedbyadmin" setting in the database:

update config set value='0' where field='siteclosedbyadmin';

Rob Mitchell's profile picture
Posts: 11

14 June 2016, 22:23

I just found this problem as the site wanted to auto-upgrade from 15.. to 16..

Could not log in with admin accounts either. As advised in this thread, I had a look at the (config) mysql but the 'siteclosedbyadmin' was already set to 0.

So felt a bit stuck, however the site error message advises that the urlsecret was needed from config.php. So I found that. Then it's the question of the form/syntax of how you use it which I found was..

www.your-mahara-site/admin/upgrade.php?urlsecret=the-secret-url-in-config-php

or something very like that. They key information is:

1)Get the $cfg->urlsecret from config.php

and

2) append [  ?urlsecret=the-secret-url...  ]  to the upgrade.php

and IT WORKS

well, did for me on this occasion. Hope it's useful.

Rob 

Rob Mitchell's profile picture
Posts: 11

14 June 2016, 22:37

nb: Little warning -  Though it wasn't complete clean in that the, not very informative,  'Something bad happened...site headers..' error message popped up afterwards.

But when I went back the site main page it was fine.

Kristina Hoeppner's profile picture
Posts: 4863

16 June 2016, 9:35

Hi Rob,

Great that you could upgrade your site. We started documenting the config.php values in the admin section of the user manual to make them more easily accessible than always having to look in /lib/config-defaults.php

http://manual.mahara.org/en/16.04/administration/config_php.html

Cheers

Kristina

 

Rob Mitchell's profile picture
Posts: 11

27 July 2016, 3:28

Yes, Thanks Kristina.

Any such clarification would be good.

Thought I would pop back on here again to share a resolution to the same problem, which I encountered again.   

Once again I was faced with the 'closed site' and 'perform upgrade now'.  The message looked like this...

"The site is temporarily closed for a database upgrade. Perform the upgrade now."

And once again, I could not log in with my admin passwords or anything. 
I tried the..

<mymaharasite>/admin/upgrade.php?urlsecret=<my-secret-url>

BUT

I encountered a problem which stated something like :- 
 ...upgrade had started in a previous operation and would I like to continue anyway.?
Obviously I say yes but it didn't happen.
There was something in the url about ' rerun=1 '. 

Then it kicked back to the permission error again. SO it seemed to me, that since I did not know how to combine the '?rerun=1' bit AND the '?urlsecret=...' into the one URL, I had to get rid of one of the checks. So the SOLUTION, however rough, that worked for me was...

[This obviously needs access to the server files...]

Hack the admin/upgrade.php file.... Comment out the urlsecret check by adding '//' in front of these lines of code, which then looked something like this.... 

//Check if we have come via browser and have the right url secret
//if (php_sapi_name() != 'cli' && get_config('urlsecret') !== null) {
//$urlsecret = param_alphanumext('urlsecret', -1);
//if ($urlsecret !== get_config('urlsecret')) {
//die_info(get_string('accessdeniednourlsecret', 'error'));
//}
//}

Then do the perform upgrade. 
This process asked again about the half-started upgrade and if I wanted to continue anyway (...rerun=1).  I affirm..

And IT WORKED!

Then I had to change admin/upgrade.php back again to put back in the ?urlsecret check by removing the commenting out of those lines.  Which looked again like this.

//Check if we have come via browser and have the right url secret
if (php_sapi_name() != 'cli' && get_config('urlsecret') !== null) {
$urlsecret = param_alphanumext('urlsecret', -1);
if ($urlsecret !== get_config('urlsecret')) {
die_info(get_string('accessdeniednourlsecret', 'error'));
}
}

Phew.  I really hope that this works out useful for someone. Sorry if I have over-explained for those in the know but I find sometimes a lot of guides cater only for the cognoscenti. So tried to pitch this low.

I noticed there were a number of sites that seemed to be faced with the same problem. So hence the share here.  

I also think this problem has been surfacing since 2011, or certainly issues with upgrades have - or so I noticed on these forums.  

Cheers

R

Ghada El-Zoghbi's profile picture
Posts: 122

27 July 2016, 8:04

Hi Rob,

Glad to hear you were able to resolve your issue.

FYI. To put rerun and urlsecret on the URL, use & between the two parameters :


<mymaharasite>/admin/upgrade.php?urlsecret=<my-secret-url>&rerun= 1

Hope that helps some out there.

Cheers,
Ghada
Rob Mitchell's profile picture
Posts: 11

27 July 2016, 23:26

haha Ghada, 

That's brilliant. I couldn't find how to do that. SOOOO much more simple, elegant and completely un-convoluted. 

That would help a lot next time and hopefully anyone who needs it will see your post before they try mine!!

Thanks a lot

Rob

9 results