Standalone Web App with Apache reverse proxy

In the early days of Web 2.0 I had to manage a CGI setup from Web 1.0. I’m pretty sure I just yanked the perl script and got it up and running. I, unfortunately, don’t remember specifics as I later fully migrated that system to standalone.

If you don’t have a working solution by Saturday, when I may have time, I’ll try to spin up a VM and take a look at Apache’s proxy capabilities for use with Xojo.

1 Like

I don’t know if you’ve looked at this one yet, but it may be exactly what you need:

Web 1.0 is available. Web 2.0 is not available.

I have attempted to make this work with web 2. I ALMOST got it a few months ago. I’ll post some config files if I can get it going sometime.

1 Like

A bit late but for anyone with the same problem. After 2 days of trying and failures, I’ve figured out how to do it on Apache2, here is my configurations:

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "/srv/www/htdocs"

    RewriteEngine On

    RewriteRule ^/application(.*)$ http://127.0.0.1:9000/$1 [P]

    RewriteCond %{HTTP_REFERER} ^https?://[^/]+/application
    RewriteRule ^(?!/application)(.*)$ http://127.0.0.1:9000$1 [P]
</VirtualHost>

And remember to enable mod_rewrite with command: sudo a2enmod rewrite then restart apache

After that, accessing localhost/application results the same as http://127.0.0.1:9000 without any issues with loading assets.

12 Likes

@OracleCom_Com thank you for your contribution.
it seems to me a very interesting solution.
do you think it can also be adapted to a web1 cgi application?
I tried it and it doesn’t seem to work (with cgi).

Is this used for web 1.0 or web 2.0?
I failed to use it on web 2.0

are you sure?
if I am not wrong, it works with web2.
I also wanted to try with a web1 cgi app, but it didn’t work.
that is why I was asking if the solution is also adaptable to web1 cgi

Web 1 does not have to be CGI though. If you build as standalone, it should work just fine.

You can use it now, I made a mistake

Thanks to @OracleCom_Com’s remarkable contribution, this topic (which was discussed at length in the past) has now been brought back to the forefront, and with a brilliant solution.

I believe Xojo Inc. should officially state whether @OracleCom_Com’s configuration is the ultimate solution for using subdirectories with “Web 2” applications on Apache.

Now, I don’t know about other people, but I will NEVER switch to “Web 2” unless I can use subdirectories, with the assurance that they will be supported for a long time by Xojo Inc.

2 Likes

You can use it. It works.

if you answered me, know that I tried shortly after seeing the configuration proposed by @OracleCom_Com.
so I know that it works.
now, it is crucial for me that Xojo Inc. approve @OracleCom_Com’s configuration (or another one) to allow the use of subdirectories and give assurances for the future.
this concept applies to other issues as well.
if Xojo Inc. does not give assurance of stability, it is definitely not advisable starting new projects or converting “Web 1” projects.
I have not done so far and will not do so.
there are already too many cases of developers struggling with the transition, who have abandoned Xojo.

P.S. I hope Xojo Inc. will state its position on this. if there is silence instead, it will be clearer than a thousand words.

What do you expect them to say? This is an Apache/Nginx issue, not a Xojo issue. This falls outside of what Xojo controls.

2 Likes

Welll, it’s Xojo’s issue also, kinda…
You see, they use the wrong pathing format for required assets in the source code of the webpage.
For example:
Currently in Xojo: “<link type=“text/css” href=”/framework/summernote.css" ← this denotes the summernote.css file should be found under example.com/framework/summernote.css even if you place the webapp under a subdomain

Correct way: "<link type=“text/css” href=“framework/summernote.css”

until a few days ago, no one had a solution.
you can’t use subdirectories with “Web 2”. that’s it.
now someone finds a possible solution.
the Xojo applications don’t run in the stratosphere but within environments such as Windows, Linux, macOS and even Apache, Nginx, etc., so it is appropriate for Xojo Inc. to state whether the @OracleCom_Com’s solution for Apache2 is usable in production, now and in the future, long term.
otherwise we are still wasting time, even in this reborn discussion.
after 2-3 years of denials, only a madman would start a “Web 2” project without any reassurance from Xojo Inc.

Xojo’s web1 and web2 only run in a certain mode, and now the directory proxy in this mode has been resolved through Apache’s rewrite method. The main thing is still the method, which cannot give any promises. What if the rewrite method changes in the future?

1 Like

I agree.
My knowledge of Apache is not extensive, but I believe that the configuration proposed by @OracleCom_Com works today and will work in the future (Apache side).
That said, I think Xojo Inc. needs to say IF that configuration works today and IF that configuration will work in the future (Xojo side).
Simply.

Do you know if there is an Issue about this?

If doing this change can help users have apps on subdirectories without breaking something, they can review and implement the change.

1 Like

I couldn’t find any related Feature Request for deploying in subdirectories, can you please open one @Giacomo_Bernardi so others can also upvote?

4 Likes