WSGIDaemonProcess为每个应用程序实例

我正在使用Apache&mod_wsgi在多个服务器上部署一个django应用程序。 我已经阅读了多个地方(包括: http : //blog.dscpl.com.au/2012/10/why-are-you-using-embedded-mode-of.html ),最好使用守护进程模式的wsgi。 这将使我能够控制每个进程的进程数量和线程数,以及其他整洁的东西:)

现在我可以在同一台服务器上拥有两个或更多的django应用程序实例(每个实例都有自己的设置,数据库等)。 例如:

  • http://team1-server/prod-instance
  • http://team1-server/test-instance

坚韧我想我明白如何为多个虚拟主机使用不同的“进程组”和“守护进程”configuration,我似乎并没有考虑到我应该怎样处理多个“子根”。

编辑:

我运行在CentOS 6.2发行版下。 在/etc/httpd/conf.d/目录中,每个实例都有一个.conf文件,如下所示:

 WSGIScriptAlias /prod-instance /opt/wsgi_applications/prod/app.wsgi 

结束编辑。

我应该使用虚拟主机,并有像http://prod-instance.team1-server/url吗? 这意味着我应该依靠networkingpipe理员来更新DNS表,这对我们的客户来说是不够快的。 🙂

我必须承认,在Apacheconfiguration方面,我经常会迷失方向。 您的帮助是受欢迎的。

谢谢!

O.

假定你没有使用过时的mod_wsgi版本,你可以这样说:

 WSGIDaemonProcess prod-instance WSGIScriptAlias /prod-instance /opt/wsgi_applications/prod/app.wsgi process-group=prod-instance application-group=%{GLOBAL} WSGIDaemonProcess test-instance WSGIScriptAlias /test-instance /opt/wsgi_applications/test/app.wsgi process-group=test-instance application-group=%{GLOBAL} 

如果您使用的是过时的旧mod_wsgi版本,请使用:

 WSGIDaemonProcess prod-instance WSGIScriptAlias /prod-instance /opt/wsgi_applications/prod/app.wsgi <Location /prod-instance> WSGIProcessGroup prod-instance WSGIApplicationGroup %{GLOBAL} </Location> WSGIDaemonProcess test-instance WSGIScriptAlias /test-instance /opt/wsgi_applications/test/app.wsgi <Location /test-instance> WSGIProcessGroup test-instance WSGIApplicationGroup %{GLOBAL} </Location>