Question

I am trying to run Trac on nginx.

There is a simple solution that consists of running the tracd server, but I'm trying to avoid that. It doesn't support unix sockets.

Instead, I'm trying to use Spawning that should be able to launch any WSGI application.

But I don't know how to use it. After deplyement, I have my cgi-bin directory with trac.wsgi in it, but I don't know how to launch it using Spawning.

It doesn't accept a file name as an argument, I have to provide the module and the application names, like spawning my_module.my_wsgi_app. But how do I do it with trac.wsgi ?

Was it helpful?

Solution

Reading Spawning docs I saw that it receives on the command line, as the first parameter, the dotted name of your application's WSGI object. Especifically for Trac, the WSGI object is defined at trac.web.main.dispatch_request [1]. Try passing this to Spawning.

But remember that Trac needs some environ variables in order to run correctly, to name a few: TRAC_ENV, pointing to your Trac Environment and PYTHON_EGG_CACHE, where Python will estract any loaded egg file.

Since Spawning does not receive a file as the first argument, you won't need trac.wsgi.

You can try this, running directly from you shell.

$ TRAC_ENV=/path/to/your/trac-env PYTHON_EGG_CACHE=/tmp/.egg-cache spawning trac.web.main.dispatch_request

Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top