Somehow, it also doesn’t make quite sense to me: How can Apache2 know that …/myapp.cgi/MyCustomRequest should be handled by the .cgi (and /MyCustomRequest shall be what’s going to ‘HandleURL’-event)? Why does it know that there’s this .cgi, and is not looking for a folder ‘myapp.cgi’ and another folder ‘MyCustomRequest’?
One other idea which I couldn’t get to work:
Can I use a Xojo WebApp as .cgi to handle a whole (virtual) “instance”? Configure Apache2 somehow so that all requests are being answered by the .cgi (but of course passing the Request to the same .cgi)?
I only managed to allow a .cgi in the root, so that http://my-ip.address/ launches the Xojo-WebApp.
But http://my-ip.address/MyRequest is then not being passed to the .cgi (along with /MyRequest) - Apache then tried to find an (obviously not existing) index-file in a folder “MyRequest”).
How are others doing their WebServices in Xojo? Do you only built them as ‘Standalone’ or .cgi?
How to design (and how to configure Apache2) it so that it can be used as .cgi, too - getting the …/myapp.cgi/MyRequest -> HandleURL ‘/MyRequest’?
Or don’t I need to bother at all, because a WebService as .cgi is not a good idea anyway - and if so: why?
I know, quite some beginner questions
Thanks if you find the time to answer some or all of my questions and/or explain how Xojo WebApp-Services running as .cgi are supposed to work.
Something is not quite right yet - I just have to figure out what and why.
So it would help to understand what Apache is doing (or maybe isn’t in my case).
But I agree that trying to use Apache->CGI the same way as a Standalone might not be the best idea (that would “make it complicated”, in order to use Michel’s words). I’m just curious if/how this could be done (or not) - to get Apache to answer all requests via a single .cgi and send all ‘virtual Paths’ in the same way a Standalone receives them.
It’s probably a lot of configuration for not much value (only to have shorter URL’s to call; such as in the Standalone version).
The only way to past HandleURL to the CGI is to rewrite http://my-ip/demo to http://my-ip/myapp.cgi/demo
Of course in not making your cgi an index file would avoid this special treatment too but then it wouldn’t be so readable.
I wasn’t quite sure because in some situations it didn’t work as expected.
Meanwhile this has been tracked down to this:
<https://xojo.com/issue/47469> - Connecting from a WebApp using the old HTTPSecureocket (with .Secure=false) doesn’t work in CGI-mode (but works in Standalone mode).