Support #7464

Apache2 mod_fcgid internal path

Added by Dusan Vudragovic over 2 years ago. Updated over 2 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:



I'm trying to deploy a Wt application to the Apache2 server using mod_fcgid. In principle, it works and I'm able to see different content associated with different internal paths. In my case, the internal path is visible in the URL as


However, I would also like to access directly (via browser bookmark) to a particular internal path, and this I can not do.

While I'm testing the application using wthttp library, it works fine, since the internal paths are passed via '?'. After that, if I compile the application using wtfcgi, corresponding GET / requests do not work. In that case, if I manually specify '?=/' such request redirects to the correct internal path.

So, my question is which component should handle Apache2 mod_fcgid https:/// GET request? Apache should somehow redirect such GET request to the corresponding , or it has to be done within the application. In other words, should I handle GET request within the application, in addition to the internal path?

Many thank, and best regards, Dusan


Updated by Roel Standaert over 2 years ago

When using mod_fcgid, and your file for example is called hello.wt, hello.wt/whatever should be routed to it.

There appears to be something up with the routing right now, that makes it so that it doesn't properly route things to the default path, I'll have to see about that.

As for the Apache side of things: I suppose if you're not accessing it through hello.wt/whatever you could use mod_rewrite to send the internal path to Wt.


Updated by Dusan Vudragovic over 2 years ago

Dear Roel,

Thank you for your message. It is not clear to me how GET 'hello.wt/whatever' request is transformed into Wt internal path. Is this done somehow automatically within the Wt, or I have to write code that reads URL path (/whatever), and forwards it into the corresponding internal path handler handlePathChange(/whatever)?

However, I found out that it is much easier to create Apache proxy redirection

ProxyPass / "http://localhost:4000/"

ProxyPassReverse / "http://localhost:4000/"

and run wthttp server in the background on the corresponding port. So far, it runs fine...

Thank you, and best regards, Dusan


Updated by Roel Standaert over 2 years ago

If you can use wthttp behind an HTTP proxy, you should absolutely do that. wthttp behind a reverse proxy is definitely the recommended deployment option for most scenarios.

If you're using FastCGI, and access hello.wt/whatever Apache will hand that information to Wt, which will then be matched against your entry points (if you're just using WRun, there's only one that should match everything (it doesn't currently and I believe that's a bug)), and everything after the path of the entry point will be interpreted as an internal path.


Updated by Dusan Vudragovic over 2 years ago

Thank you very much. Best regards, Dusan

Also available in: Atom PDF