如何配置apache 2.4以同时运行django和flask应用程序?

时间:2018-09-17 15:10:33

标签: python django flask httpd.conf apache2.4

我们正尝试在apache 2.4上同时运行一个django Web应用程序和一个flask Web应用程序。我们成功启动并运行了django Web应用程序。但是我们正在努力添加flask实例。

httpd.conf:

LoadModule wsgi_module "C:/Program Files/Python36/lib/site-packages/mod_wsgi-4.6.4-py3.6-win-amd64.egg/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd"
WSGIScriptAlias / "C:/projects/production/title-project/title/wsgi.py"
WSGIPythonHome "C:/Program Files/Python36"
WSGIPythonPath "C:/projects/production/title-project"

Alias /static/ C:/projects/production/title-project/static/

<Directory C:/projects/production/title-project/static>
    Require all granted
</Directory>

<Directory "C:/projects/production/title-project">
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>

这个,我们放了没有任何虚拟主机标签。现在,如果我们尝试将虚拟主机标签放在上述代码段之后,

<VirtualHost *:8080>
    ServerName localhost
    DocumentRoot C:/projects/production
    <Directory  "C:/projects/production/">
        Require all granted
    </Directory>
    LoadModule wsgi_module "C:/Program Files/Python36/lib/site-packages/mod_wsgi-4.6.4-py3.6-win-amd64.egg/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd"
    WSGIScriptAlias /flaskapp C:/projects/production/title-reporting/reporting.wsgi
    <Directory C:/projects/production/title-reporting>
        Require all granted
    </Directory>
</VirtualHost>

我们根本无法连接到flask应用程序。我们知道上面有问题。但是我们对Apache没有太多经验,我们希望获得一些帮助。谢谢。

0 个答案:

没有答案