Bug #2103

Trouble Setting up mod_fcgi

Added by Bud T over 8 years ago. Updated over 8 years ago.

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


Estimated time:


Could someone tell me why is this fatal error occurring when running test binary from command line?

[user@st root]$ /var/www/approot/app.wt
[2013-Aug-12 19:02:45.392091] 18827 - [info] "WServer/wtfcgi: initializing relay server"
[2013-Aug-12 19:02:45.393300] 18827 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '/var/www/approot/app.wt')"
[2013-Aug-12 19:02:45.394545] 18827 - [info] "wtfcgi: spawned session process: pid = 18828"
[2013-Aug-12 19:02:45.395317] 18827 - [info] "wtfcgi: reading FastCGI stream from stdin"
[2013-Aug-12 19:02:45.396462] 18827 - [error] "wtfcgi: fatal: accept(): Socket operation on non-socket"
[busr@st root]$ [2013-Aug-12 19:02:45.416686] 18828 - [info] "config: reading Wt config file: /etc/wt/wt_config.xml (location = '/var/www/approot/app.wt')"
[2013-Aug-12 19:02:45.417385] 18828 - [info] "WServer/wtfcgi: initializing shared wtfcgi session process"

Also, it isn't clear to me how one goes about setting up fcgi. What is the difference between fcgi and fastcgi? The Fedora 17 repository doesn't have any fastcgi libraries:

# yum install mod_fcgi fcgi-devel fastcgi-devel fastcgi
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * fedora:
 * updates:
No package mod_fcgi available.
Package fcgi-devel-2.4.0-18.fc17.x86_64 already installed and latest version
No package fastcgi-devel available.
No package fastcgi available.
Nothing to do

I don't see how to set up Wt to use mod_fcgi on this server (Fedora 17 with Apache2). After applying permissions and placing app.wt into application root, calling Apache returns 403 page.


Updated by Bud T over 8 years ago

With respect to the content of this support request (not a bug): I was able to configure fcgi (not fastcgi, which is a proprietary version I'm learning). The fatal error above was apparently due to the fact that fcgi cannot be run from command line, only from web server.

My sample app runs from a web server now, but only after I hacked something. I'd like you to please explain something... As I wrote above:

"After applying permissions and placing app.wt into application root [/var/www/approot], calling Apache returns 403 page."

But if I move that app.wt file into my document root - /var/www/html - it runs. So I don't understand the purpose of having this flag in the Wt cmake:


What is the meaning of RUNDIR? And how does it related to /var/run/wt ? And how are these related to this variable in wt.conf?

      FcgidInitialEnv WT_APP_ROOT /var/www/approot

I don't see why having app.wt in document allows it to run while it won't run when in approot. And none of these various other variables noted here make any sense to me.


Updated by Wim Dumon over 8 years ago

  • Status changed from New to Feedback

Hello Brad,

RUNDIR is a place where Wt will store temporary files (named pipes) that it requires for session management. It's default value is /var/run/wt. It has nothing to do with approot. Approot is a convenience concept that we introduced, that you can use in your application, to configure a place where you can store files that your application requires to run, but that are not served through http. Typical examples are message resource bundles, sqlite databases, ...

By default, FCGI requires that your executable is in your document root. Instead of downloading that file, FCGI will execute it. On the other hand, most servers allow to configure that a particular path is forwarded to an FCGI application, in which case you can place the FCGI executable somewhere else, e.g. in the approot directory. You then also have to start the FCGI process yourself (with spawn-fcgi if I remember correctly). This should be documented in the documentation of your web server.


Also available in: Atom PDF