Deploying to Windows IIS

I will be replacing a third party web app that has gone out of business using Xojo. Currently the existing web app is accessed from a home page being served from IIS. To keep the same functionality I am thinking I should try to deploy the Xojo web app as a reverse proxy standalone Xojo web app as show in the instructions found here .

Am I on the right track. Or should I do it as a cgi. I am pretty sure at the moment that I do not have any choice but to use IIS. If in fact I am on the right track, I am so far not able to get the XojoText web app to work following the above instructions. I will hold my questions in this regard until I am satisfied that I am going in the right direction.

Thanks in advance for any help here. Thus far all of my Xojo experience has been on Macs with 3 successfully deployed stand alone web apps.

John

If you use standalone you don’t have to use IIS. The app is, effectively, it’s own web server.

I use this technique with no trouble, but as Bob says you can deploy without any web server. However if you want to implement SSL then I’d recommend using IIS as that will take care of all the SSL stuff leaving your app to do its stuff (yes Bob I know you can deploy standalone with SSL, but by splitting that off you do gain in performance). Also redirecting through IIS doesn’t require a port as part of the request string.

If I can go with standalone I will, but I am anticipating having a problem with the port number being exposed in the URL. My other web apps deplayed as standalone apps have had users blocked by their firewalls because of the exposed port number . I cannot afford that to happen with this new project.

We have several web sites running on this IIS server so using port 80 is out of the question. Is their a way to have a standalone app running on say 8080 without exposing the port number in the URL? I am under the impression that the only way to do this with Xojo is running as a cgi or a reverse proxy.

John

Using IIS you can redirect port 80 for that site to your standalone app running on any other port.

Have a look at http://demo2.axisdirect.nz which is a web app running on a non-standard port. This is actually a demo to show another user (with their project) that it does work.

PM me if you would like me to help with the IIS configuration.

Thanks Wayne. I thought that was being done using a reverse proxy. Is there an easier way to do it?

I am 1 hour later than you here in Hawaii. Will PM you a bit later today.

Thanks,

John

[quote=291557:@John Baughman]Thanks Wayne. I thought that was being done using a reverse proxy. Is there an easier way to do it?

I am 1 hour later than you here in Hawaii. Will PM you a bit later today.

Thanks,

John[/quote]

The documentation from the TS link was written by me. IIS is a webserver. To serve a Xojo Webapplication on stand-alone mode, you’d be best off using a reverse proxy. It allows you to use IIS settings, security and configuration while still having xojo web application (as @Bob Keeney said) running next to it.

You can probably also use cgi, but it makes things slow on IIS.

Then there is the absolute stand alone mode, where you open a port on the firewall and use that for xojo stand alone web app deployment. But, you’d be stuck with a port added after the domain name.

On windows I would try to use nginx as a loadbalancer in front of my xojo standalone Webapps.

Then you can use URLs without a port number and configure nginx to distribute the calls to as many copies of your webapp as you like.

I do this on Linux vps with haproxy. On windows one can use nginx in front of IIS :

https://goo.gl/CYEJfP

Hey @Derk Jochems I thought that link was from @Oliver Osswald ? It is certainly published from his site. Either way thanks for this, the one thing I found very frustrating was rediscovering this then writing it up only to find I was too late!

No, the document was not written by me. Now I don’t remember where and why i made it available from my site. If Derk Jochens prefers to take it down again, I’ll do so.

Usuallly I leave old stuff up there in order to not breaking any links.

Well thanks you to too @Oliver Osswald I put in a FB request to have this linked from the xojo docs site & that was implemented real quick by @Paul Lefebvre and it seems to have paid off today for @John Baughman!

I wrote it. But oliver hosts it in favour of the community.

[quote=291603:@Oliver Osswald]No, the document was not written by me. Now I don’t remember where and why i made it available from my site. If Derk Jochens prefers to take it down again, I’ll do so.

Usuallly I leave old stuff up there in order to not breaking any links.[/quote]

No, please keep it.
I thought i given you permission by PM, not sure anymore. I had so many people requesting it…

Thanks you to Wayne Golding for helping my off line last night.

I studied what wayne did for me and have recreated everything myself to make sure I understand it. the challenge last night was to set this up using localhost. I have boiled it down to 3 steps. The Xojo test web app is running listening on port 8080…

  1. Create a new host…
    C:\Windows\System32\drivers\etc\hosts
    127.0.0.1 Xojo

  2. Add a new Web Site in IIS…
    Site Name: XojoTest
    PhysicalPath: C:\XojoRedirect (an empty folder)
    Binding: Type: http; IP Address: All Unassigned; Port: 80
    Host Name: Xojo

  3. With the new XojoTest web site selected click on the URL Rewrite icon. Click Add Rule and create a Reverse Proxy rule…
    Forward to server name: localhost:8080 (this is the first field in the Reverse Proxy dialog). Leave everything else as is.
    This step creates a web.config file containing the rule in the previously empty XojoRewrite folder

  4. Now the Xojo test web app can be reached on the same machine with http://Xojo/

OK. That works. Now I am contmplating how I will do this on the production server.

Shouldn’t I be able to do this with a virtual directory or application inside the Default Web Site? When I try it this way the Xojo WebApp Launches then fails. I am thinking that this is most likely due to how the XojoTest web app is written and should work with my new web app. This was even easier to set up…

  1. Add an application to the Default Web Site
    Alias: XojoTest
    PhysicalPath: C:\XojoRedirect (an empty folder)

  2. With the new XojoTest web site selected click on the URL Rewrite icon. Click Add Rule and create a Reverse Proxy rule…
    Forward to server name: localhost:8080 (this is the first field in the Reverse Proxy dialog). leave everything else as is
    This step creates a web.config file containing the rule in the previously empty XojoRewrite folder

  3. Now the Xojo test web can be reached with http://localhost/XojoTest/. (web app does launch but immediately fails as if the web app shut down)

I am also able to launch the web app from anther computer on the same network after changing the Reverse Proxy to 192.168.1.150:8080. For some reason Safari on a mac cannot open the launch page if I try using the external IP address of the host computer.

Otherwise we are going to have to set up an another domain pointing to this server, which we would rather not do if at all possible.

The Default Wet Site hosts many other web applications which are accessed with http://qmc-fpm.com/appname. Ideally I want to access my yet to be created xojo web app with http://qmc-fpm/MyNewXojoWebApp. Am I correct in assuming that I will be able to get this to work?

Thanks

John it is not another domain, but another server on your current domain e.g. api.axisdirect.nz vs www.axisdirect.nz there is only one domain involved (axisdirect.nz), but two servers. Both servers can be on the same machine using the same IIS server and that is achieved using bindings, so two IIS sites, one is the default, the other is the xojo web app.

Last night I edited your hosts file to create a virtual dns instance of a server that pointed to your localhost and then bound the site I created on IIS to that server and using URL rewrite I forwarded all requests for that site to your stand alone Xojo app on its own port.

Adding a server to a domain is pretty simple & usually doesn’t cost a cent (apart from your time).

Is what you did last night, ie binding the xojo site to “a virtual dns instance of a server” different than binding it to a server added to my current domain? I did a google search on how to add a server to a domain, but the closest thing I could find was help for adding a sub domain to a domain using the DNS Manager. Is that what you are referring to? My DNS Manager is throwing an error so I have not been able to pursue this on my own. I think the error is possibly due to the fact that I am running windows in a virtual machine.

If the URL to access an app or virtual directory in the Default Web Site looks like http://qmc-fpm.com/fmserver, what would the URL look like to access the Xojo web app. If you are referring to a subdomain, then I am guessing that it would look like http://xojo.qmc-fpm.com xojo being the name of the server bound to the web site.

In my test setup I can access the default web apps from another computer on my network using the URL http://192.168.1.150/fmserver. Is it possible to access the xojo site we created last night in a similar manner?.

I am sorry, but I obviously do not have a handle on this kind of stuff to the point of not being able to even ask an intelligent question.

If you add a line to the hosts file on another computer in your network with the same name, but the ip address of your computer then yes you will be able to access that site. You can also add a dns entry to your DNS server (if you have one) and then all computers will be able to access that site. Windows Desktop OS’s only allow 10 concurrent connections, so you’re probably limited to 2-3 external sessions.