http.conf中的多个应用程序和断言错误

时间:2018-04-03 09:56:38

标签: python django apache

我正在使用python / Django网络应用程序,在我的上一个项目之后,我不得不设置我的apache http.conf来同时处理两个应用程序。

两个应用程序在httpd.conf中单独运行时都是intenteded,但是当我将它们放在文件中时,我开始遇到asertion错误问题。

httpd.conf部分与app:

IHostedService

例如,如果我在App A上进行更改并重新启动apache,则A应用程序可以正常运行,但如果我尝试使用B应用程序,则会出现断言错误。

编辑:经过一些研究后,我发现这个错误来自于我试图在同一个wsgi进程上运行两个应用程序,从我收集的内容我需要在守护进程模式下使用wsgi,这样每个应用程序都有一个wsgi进程,但我可以& #39;找到一种方法让它在Windows上运行。

这是我编辑过的httpd.conf

<VirtualHost 200.1.2.11:8080>
    ServerName 200.1.2.11:8080
    WSGIScriptAlias / "E:/Applications/var/www/YYY/YYY/wsgi.py"
    Alias /static/ "E:/Applications/var/www/YYY/static/"
    Alias /templates/ "E:/Applications/var/www/YYY/templates/"
    <Directory "E:/Applications/var/www/YYY/static">
        Require all granted
    </Directory>
    <Directory "E:/Applications/var/www/YYY/YYY">
        <Files wsgi.py>
            Require all granted
       </Files>
    </Directory>
</VirtualHost>

<VirtualHost 200.1.2.11:8081>
    ServerName 200.1.2.11:8081
    WSGIScriptAlias / "E:/Applications/var/www/XXX/XXX/wsgi.py"
    Alias /static/ "E:/Applications/var/www/XXX/static/"
    Alias /templates/ "E:/Applications/var/www/XXX/templates/"
    <Directory "E:/Applications/var/www/XXX/static">
        Require all granted
    </Directory>
    <Directory "E:/Applications/var/www/XXX/Axereal_Gestion_Mouvement">
        <Files wsgi.py>
            Require all granted
       </Files>
    </Directory>
</VirtualHost>

WSGIPythonPath E:/Applications/var/www/YYY;E:/Applications/var/www/XXX;
WSGIPythonHome "C:/Python27"

问题在于此配置,我收到此错误:

<VirtualHost 200.1.2.11:8080>
        WSGIDaemonProcess DjangoSite1 display-name=%{GROUP}
        WSGIProcessGroup DjangoSite1

        ServerName 200.1.2.11:8080
        WSGIScriptAlias / "E:/Applications/var/www/YYY/YYY/wsgi.py"
        Alias /static/ "E:/Applications/var/www/YYY/static/"
        Alias /templates/ "E:/Applications/var/www/YYY/templates/"
        <Directory "E:/Applications/var/www/YYY/static">
            Require all granted
        </Directory>
        <Directory "E:/Applications/var/www/YYY/YYY">
            <Files wsgi.py>
                Require all granted
           </Files>
        </Directory>
    </VirtualHost>

    <VirtualHost 200.1.2.11:8081>
        WSGIDaemonProcess DjangoSite2 display-name=%{GROUP}
        WSGIProcessGroup DjangoSite2

        ServerName 200.1.2.11:8081
        WSGIScriptAlias / "E:/Applications/var/www/XXX/XXX/wsgi.py"
        Alias /static/ "E:/Applications/var/www/XXX/static/"
        Alias /templates/ "E:/Applications/var/www/XXX/templates/"
        <Directory "E:/Applications/var/www/XXX/static">
            Require all granted
        </Directory>
        <Directory "E:/Applications/var/www/XXX/Axereal_Gestion_Mouvement">
            <Files wsgi.py>
                Require all granted
           </Files>
        </Directory>
    </VirtualHost>

    WSGIPythonPath E:/Applications/var/www/YYY;E:/Applications/var/www/XXX;
    WSGIPythonHome "C:/Python27"

Edit2:

我刚刚发现WSGIDaemonProcess / WSGIProcessGroup对于Windows是不可行的,试图寻找可以在Windows上运行的东西,如果有人管理过它并且可以解释它会很棒。

0 个答案:

没有答案