Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't mod_wsgi support daemon mode on Windows?

On http://code.google.com/p/modwsgi/ one can read this statement

Daemon mode of mod_wsgi will however only be available on Apache 2.0 or 2.2 running on UNIX, and only when the Apache runtime library underlying Apache has been compiled with support for threading.

What's the reason there's no support for daemon mode under Windows?

I found the above after getting

Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module not included in the server configuration

error from Apache. It's not a problem with module's inclusion as WSGIScriptAlias directive works ok. I guess the error I get is due the limitation described on the mod_wsgi's wiki.

like image 580
Piotr Dobrogost Avatar asked Mar 19 '11 21:03

Piotr Dobrogost


2 Answers

Windows doesn't provide UNIX style fork() system call and so process spawning where child process inherits parent process memory image isn't possible. Apache/mod_wsgi requires fork().

like image 99
Graham Dumpleton Avatar answered Nov 10 '22 06:11

Graham Dumpleton


For all who, after reading Graham's answer, want to know more on fork() on Windows here are questions related to this subject:

What is the closest thing windows has to fork()?
substitute for fork()ing? in windows.
CreateThread vs fork()
fork/chroot equivalent for Windows server application
Where does Microsoft Windows 7 POSIX implementation currently stands?

The two interesting things mentioned in the threads above are:

  • Interix - an optional, full-featured POSIX and Unix environment subsystem for Microsoft's Windows NT-based operating systems.

  • Cygwin's fork implementation

In addition I asked Does Interix implement fork()?

like image 43
Piotr Dobrogost Avatar answered Nov 10 '22 06:11

Piotr Dobrogost