Running Xojo Web App As A Web Service In Windows Server

Hi Guys,

All of my agony are now gone for uploading and running my first xojo web application on Windows 2008 server.

Since 2013, I rented Windows VPS under www.accuwebhosting.com which I hosted all my ASP.NET programs.
Now, since im switching to XOJO I contacted my hosting provider if they can help me to setup XOJO cgi.
I found the name “ALLEN S.” ,one of the customer service there who setup for me and run my application instantly.

GREAT GREAT GREAT!

I can run now my XOJO application using MSSQL 2008r2 database!

Hi Ronaldo. I’m also with Accu Web on a Windows 2012 VPS server and am considering deploying a web app rather than a consle app to run a license manager service for my software. I don’t need a front-end GUI to access the app so am wondering whether I should go the standalone route and access the app through a port or via cgi route and how to deploy to my VPS for each method.

I also need to manage my ASP.NET apps on the same VPS so any advice would be greatly appreciated.

Thanks!

Hi Denise.

I experience problem during running my xojo webapps on my MS SERVER. vps.

Its ok when displaying records from my database. Until I notice something.

I create a simple xojo web app. 1 textbox and 1 button. My objective is just to display the content of textbox once the button clicked.

But it fails to display it.

I called the attention of Allen to help me on my trouble but we never fixed the problem.

So I leaved the ACCU for xojo and switch to the XOJO CLOUD now.

Im still hoping that soon, there is a way to fix it.

Thanks for your reply. As I mentioned, I don’t need GUI so am considering running it as a standalone web service instead and since it is a simple service retrieving xml and returning xml I don’t want to go to Xojo Cloud for this one thing and would rather have it on the VPS I already pay for and run my other ASP.NET sites on.

I found these links to regarding running as web service:

http://developer.xojo.com/running-a-standalone-web-app-in-the-background
http://www.realsoftwareblog.com/2012/03/running-standalone-web-application-as.html

And this about setting up reverse proxy:

http://osswald.com/xojo/RealStudioWebEditionStandAloneWindowsServerDeployment.pdf

I am wondering how to ensure the service automatically restarts if it crashes due to an error or out of memory exception etc.

If anyone has any advice that would be great.

I haven’t tried to run console app.
For sure it will run!

Maybe there is something wrong with the javascript pearl or something that might cause my program behaving abnormally.

By the way, thanks for the link. I may asked allen if he can help me again.

No problem. I have opened a ticket with them asking for advice and will report back if I find out anything.

In the meantime hopefuly someone else here has experience with running Xojo Web app as a service on Windows and can help us work out the best way to keep it alive and recover from a crash.

In the meanwhile, try to contact Allen.

He’s the only one who had helped me working my xojo program works.

Then try to upload you program for trial.

Can I suggest you change the title of this thread to something more appropriate like “Running Xojo Web App As A Web Service” or shall I just start a new thread with that title?

I dont know how to change the title.

If you can guide me, I will.

I think you just click in the original title (scroll up to top) and you can edit it.

Great!

Done.

Thank you! I will now repost the issue:

[quote=291716:@Denise Adams]I don’t need GUI so am considering running a Xojo web app as a standalone web service instead of cgi and since it is a simple service retrieving xml and returning xml I don’t want to go to Xojo Cloud for this one thing and would rather have it on the VPS I already pay for and run my other ASP.NET sites on.

I found these links to regarding running as web service:

http://developer.xojo.com/running-a-standalone-web-app-in-the-background
http://www.realsoftwareblog.com/2012/03/running-standalone-web-application-as.html

And this about setting up reverse proxy:

http://osswald.com/xojo/RealStudioWebEditionStandAloneWindowsServerDeployment.pdf

I am wondering how to ensure the service automatically restarts if it crashes due to an error or out of memory exception etc.

If anyone has any advice that would be great.[/quote]

I use the service control manager to create the service (sc command from an administrator cmd.exe session) then adjust the recovery settings via the gui.

You can also set the recovery options via the command line using the sc failure command see below

[code]C:\WINDOWS\system32>sc failure
DESCRIPTION:
Changes the actions upon failure
USAGE:
sc failure [service name] …

OPTIONS:
reset= <Length of period of no failures (in seconds)
after which to reset the failure count to 0 (may be INFINITE)>
(Must be used in conjunction with actions= )
reboot=
command=
actions= <Failure actions and their delay time (in milliseconds),
separated by / (forward slash) – e.g., run/5000/reboot/800
Valid actions are <run|restart|reboot> >
(Must be used in conjunction with the reset= option)[/code]

That’s very helpful. Thanks, Wayne.

We use nssm.cc
Nssm stands for non sucking service manager. It is very easy with GUI. We have had a standalone running as a service for a couple of years with no problems.

Thanks, Gary. I took a look at the usage page and it looks quite complex to set up and configure. Do you have to install the service (web app) via nssm or can you install it via Windows Service Manager and then just tell nssm to monitor it etc? And any advice on the simplest way to get it up and running and monitoring web app service and ensuring it is kept alive if it fails in some way?

Also two other related questions:

  1. Once the standalone web app is installed and running as a Windows service, if I want to update the build, is it as simple as stopping the service, replacing the build files and then just restarting the service or would I have to stop and remove the service and reinstall it?

  2. If I place the web app in Program Files sub-folder and I want to write an error.log file in UnhandledExpection event, will it write to subfolder of Progam Files if I set f.Permissions = &c666 or do I have to place the log file somewhere else?

Denise
Nssm will install the service for you. Just download it and fire up a powershell as administrator. Enter the path to the nssm.exe and then type in nssm install. A gui window will open asking for the standalone program name and a name for the service and also options if you need them. Nssm does basically the same installation as Sc but with a gui and nssm will monitor and keep your standalone up and running. Once the service is running you can change the options using the service control manager( See Wayne Goldings post above).
Thanks

Thanks, Gary. While I was waiting for a response from the forum my hosting company installed it via Windows Service Manager. Is there a way to still use Nssm or do I have to remove the service and reinstall using Nssm? And as per above, how easy is it to replace web app files with an update? Do I have to remove service and reinstall every time?

If it is already setup as a service then I would not remove it. The service control manager can monitor the state for you. Just check the settings.
We just stop the service and install the latest standalone then restart the service. It works for for us.
Thanks