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 )
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.
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: