Learning Xojo

In this article I described how to set up your own Linux server for deploying Xojo Web 2 App.

How To Build a Linux Server for Xojo Web 2
With Xojo Web 2, it becomes relatively easy to set up a Server and run yourfirst App. You would not even need an own webserver as a Xojo Web 2 App hasbuilt-in its own. But in today’s world, running a Webapp is one thing; runningit securely a different story. This beginner’s guide aims to enable y…

Now the obvious next question is: can I run multiple apps on one server? Of course this depends on the hardware of your server, and how many users will access your apps in parallel.

But from a configuration perspective it is quite straightforward. Remember that we installed Nginx and we created an own configuration file in sites-available for our Test Application. The redirecting part is the important bit in that file. Let's recap:

location / 
{
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto $scheme;
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header Host $http_host;
   proxy_pass http://127.0.0.1:8080;

}

We used port 8080, because Xojo's Test Application is using that port. However, if you have a paid license, you can compile for your own port.

In the Xojo IDE look for Build Settings / Shard

On the right hand side you will see that you can change the port which will be used for your compiled product:

Let's assume you want to deploy 3 Apps. Then you will need to define our own port per App:

  • App1 => Port 9000
  • App2 => Port 9001
  • App3 => Port 9002

Of course you will need 3 domains or subdomains as well, so for instance:

  • app1.xojodocs.com
  • app2.xojodocs.com
  • app3.xojodocs.com

And all you need to do now, is repeating the configuration of "sites-available/enabled" from my article for each of those domains and of course define a certbot certificate for each of these pages.

Your structure to place all those apps in your Linux instance could look like:

/var/www/html/app1/
/var/www/html/app2/
/var/www/html/app3/

The important part is that each configuration file for every app will reflect the specific port of that app! This means that proxy_pass http://127.0.0.1:8080; will change to proxy_pass http://127.0.0.1:9000; and you will have to use port 9002 for the second app, port 9003 for the third app, etc.

Finally don't forget that you need as well to create a service for each app!

But overall, it is very easy to technically install multiple apps on one server. If your server has enough power to serve all of them in parallel, is of course a different topic. But you will find that out very quickly.

Comments

Sign in or become a blog.xojoDOCs.com member to join the conversation.
Just enter your email below to get a log in link.



You’ve successfully subscribed to blog.xojoDOCs.com
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Your link has expired
Success! Check your email for magic link to sign-in.