Reload WebApp

Hi,

If I want to update my WebApps (CGI), I interchange the files of the App. But on the Apache the ‘old’ App is still running (even, if there are no sessions) and if I reload the App, the old Version is showed again.

I always have to shutdown the Server.

Is there a better way to launch new versions without shutting down the system (there are other webapps, I don’t want to even quit )

Thanks

Lars

Lars,

This may help: http://www.1701software.com/blog/upgrading_xojo_cgi_apps.php

Can’t you simply kill the app process through SSH ?

That’s what I do, seems to work fine for me. I do tail the logs for a bit before doing so making sure there are no active users, but its pretty easy with the web app I have deployed to production because it is used pretty much from 7a-9p. Outside of those hours it is rarely used.

You could build a system into your app for shutting it down at a particular time. That way, you could start sending warnings to users ahead of time, telling them it’ll be down for maintenance, etc. then call App.Quit when you’ve hit your target time. Here’s the tricky part: if you dont already have the new app on the server, ready to be installed, a user could certainly access the old app while you uploading the new one. make sure you delete or rename the .cgi file so that new users dont launch the old app.

Another idea is to make a small web app which just shows a Down For Maintenance page. you would swap out your app’s .cgi file with that one, kill the old app, upload the new one, and then swap in the new .cgi file.

Typically though, you would also want to restart apache gracefully so as to not kill off any other legitimate traffic, like if you had another web app running.

service httpd graceful

I always rename the folder of my built web app to include a version number and upload it like that. I use a symbolic link to point to the current version, so once I’ve killed the old (current) version I then simply:

$ rm the-app; ln -s the-app-123 the-app

Hey! I did it with @Phillip Zedalis solution! I quit the app, if I rename the .cgi-file.

I think, it’s the simpliest way!

Thanks for your answers!

I’ve been using Phillip’s solution for almost a year now and it’s worked perfectly every time…

I’ve been using Phillip’s solution. Works great, but can anyone add a warning of shut down and a chance for the user to save his files?

@Phillip Zedalis url to the solution is no longer valid.

Does anybody have a link that works?

It is on the 1701Software.com site : http://www.dev.1701software.com/blog/2013/09/08/upgrading-xojo-cgi-apps

I’m trying to incorporate that code, which works fine with code that will sure fire quit an app that has had no activity.

Currently I have:
App Open Event:

App.AutoQuit = True
App.Timeout = 1
App.SessionTimeout = 1

Session open event:
Self.Timeout = 30

Session Timeout event:
Self.Quit

However after the Timeout it remains in running process.

How do you guys handle this?

Here’s the test app: https://dl.dropboxusercontent.com/u/125593/RSATestApp.xojobinaryproject

Thanks Rich