0

I have a django-app using sites framework and need to deploy in a single apache virtual host. I was using mod-python with PythonInterpreter and it was working fine. But mod-python is deprecated and I want to migrate to wsgi. But I can figure out how to configure this scenario using wsgi. Can anyone help me? I guess just using WSGIScriptAlias for each site is not working because it is running on same python interpreter.

Can anybody help me?

msbrogli
  • 483
  • 3
  • 11
  • I found this directive: WSGIApplicationGroup (http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIApplicationGroup). I'm figuring out if it solves the problem. – msbrogli Mar 13 '12 at 23:25

1 Answers1

2

The default for WSGIApplicationGroup is %{RESOURCE} which expands to include the value of ServerName and the application mount point. Thus each distinct virtual host would be in separate sub interpreter by default.

This means that if you have multiple VirtualHost definitions with different ServerName setting then they would be distinct.

In general though, it would be better to create a distinct daemon process group for each site and delegate each to a different set of processes. This is done using WSGIDaemonProcess and WSGIProcessGroup directives.

When each site is in a separate daemon process group, then often better to set WSGIApplicationGroup to %{GLOBAL} so using main interpreter in process as that avoids some issues with third party C extension modules for Python which aren't written so as to work in sub interpreters.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • But WSGIDaemonProcess's context is virtual host. How can I do that using only one virtual host? My sites are: http:///site1/ and http:///site2/. – msbrogli Mar 14 '12 at 00:47
  • It is not restricted to VirtualHost. It can be outside of VirtualHost and then each VirtualHost have a WSGIProcessGroup which refers to it. As I said though, you are better off with one daemon process group per site. – Graham Dumpleton Mar 14 '12 at 05:13