Maintenance mode

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
8/9/2011 3:55:08 AM
Gravatar
Total Posts 123
/Mats Lillnor

Maintenance mode

Hi Joe!

This is a feature that I would really like and that probably is easy to implement (my guess).

Lots of times I want to do several updates to a site that should be published together and do not want people accessing the site during this time.

Now I have solved it by removing the host-header from the site and start another site with the host-header for the site-name with a static page saying "Server maintenance, please come back later" and then using another host-header that I have in my /etc/hosts to access the original site to make the changes.

This is very cumbersome (especially for me since I run my sites in a load-balancing cluster, so I need to do this on several nodes).

A very nice solution would be to be able to set the site in "maintenance mode" so no matter what page is requested (except for the login-page) a cutomizable maintenance page is shown. In this mode only administrator-login is allowed and when you are logged on as an administrator you could manage the site any way you like, including upgrading the site to a new version and change skin (the skin should not affect the maintenance page).

This would in my opinion be a very useful and welcome feature. I think that Joomla for instance has this functionality.

 

Best regards,

/Mats

8/10/2011 6:57:29 AM
Gravatar
Total Posts 18439

Re: Maintenance mode

Hi Matz,

I already have a feature request for this in our project tracker. It is something I would like as well and will get to it when I can. However, I don't think an exception would be needed for the login page since the admin could and should login before taking the site offline. In fact if we make it possible to take the site offline from the ui then the admin would have to already be logged in to do that.

Best,

Joe

8/10/2011 7:59:09 AM
Gravatar
Total Posts 123
/Mats Lillnor

Re: Maintenance mode

Ok, just make sure there is not the risk of beeing locked out.

I mean if you are logged in as Admin, then set the site in Maintenance and close the browser, not nice if you do not have the ability to log in again and turn the maintenance mode off :-(.

 

/Mats

 

8/10/2011 8:08:01 AM
Gravatar
Total Posts 18439

Re: Maintenance mode

Probably it will be implemented with a combination of a site setting and a Web.config setting like AllowClosingSites="true" in Web.config and site.IsClosed which the admin can set from the ui. If the admin gets himself locked out he can temporarily set AllowClosingSites="false" in Web.config then he can login again, then he can change it back to true. The admin could also use a persistent cookie and then closing the browser will not log him out.

Best,

Joe

8/13/2011 10:05:07 PM
Gravatar
Total Posts 355

Re: Maintenance mode

Joe - nopCommerce has a "store closed" feature which routes all incoming users to the "store closed" default page, but excludes the admin login page.  Perhaps it could work the same way for mojo?

8/14/2011 4:30:03 AM
Gravatar
Total Posts 123
/Mats Lillnor

Re: Maintenance mode

Yes, I also think that would be prefferably to be able to log on when the site is offline.

Being dependent of cookies to remain the connection does not seem to be a good idea and there is definitely a risk to be locked out. Also there could be several persons working on a site wit different computers and I also use several computers and on top of that use different browsers to test the functionality and so on.

Absolutely there must be a way to log on to the site as admin when the site is offline I think.

 

/Mats

 

8/14/2011 6:59:07 AM
Gravatar
Total Posts 18439

Re: Maintenance mode

ok, I hear you load and clear, when I implement this I will make it allow login when the site is closed.

Best,

Joe

8/14/2011 3:46:11 PM
Gravatar
Total Posts 355

Re: Maintenance mode

That would be wonderful! Since one of the times we need "maintenance mode" is during site upgrades, it would be helpful to still be able to run setup, even when the site's "closed to the public". Just sayin'.

8/15/2011 7:28:19 AM
Gravatar
Total Posts 18439

Re: Maintenance mode

Hi Carole,

When I build this feature it will not be a perfect solution for upgrading, it might work for some or most upgrades but consider what will happen if there are schema changes to mp_Sites table which maps to the SiteSettings object. (similar issues with other key objects and schema changes may also be a problem)

The idea would be to check if(siteSettings.IsClosed) show the closed content

However if the upgrade has a schema change to the mp_Sites table then when you upload the new files and mojoPortal.Web.dll lands in the /bin folder it will cause the app to recycle and clear the cache and then when we try to get a SiteSettings object on the next request it will cause an error because the setup page has not yet run and the schema expected in code is not matching the schema in the db. So at this point it will handle the error and redirect to the setup page. The setup page will only run if it is not disabled or if the request is from an admin user currently logged in. Then once it runs everything should be fine again.

So really the safest way for an upgrade, particularly if using a slow ftp connection would be to take the site offline using the feature built into ASP.NET for taking a site offline. I've discussed this in other forum posts but realized it was not documented in the documentation, so I've just updated the Upgrading Instructions to include this information.

So the planned feature for closing a site is not really the solution for upgrading but for other scenarios where you may want to block user access but not admin access.

Note also that we already have a feature to close WebStore which would be useful if making a lot of price changes or other scenarios. You could close the store a few minutes before upgrading to prevent people from getting to the checkout process just before you upgrade. You can tell from the Cart browser whether there is someone with recent cart activity or not so you can determine whether you are about to prevent a sale by closing the store.

Best,

Joe

10/1/2011 12:31:00 PM
Gravatar
Total Posts 123
/Mats Lillnor

Re: Maintenance mode

I see that you have release version 2.3.7.0.

I haven't downloaded it yet, but I tested the Demo-site. I can't find any option to set the site in maintenance mode.
Didn't this feature make it into 2.3.7.0 or is it just me not finding it?

Also, when looking around I found "Activity Queue" under Avvanced Tools. What is that?

 

/Mats

 

10/2/2011 10:23:05 AM
Gravatar
Total Posts 18439

Re: Maintenance mode

Hi Mats,

Sorry but I did not get to implement the maintenance mode in time for this release. Hopefully I will get to that for the next release.

If you mean Task Queue, that is nothing new it has been there a long time. You can monitor tasks there such as the task that rebuilds the search index or the task that send a newsletter.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.