简体   繁体   中英

Apache 2.4 - multiple WSGI Virtual Hosts (different ports) hangs after few requests from one to another on Windows 10

I'm trying to host two different apps on different Virtual Hosts with different ports on Windows 10. Problem is that apache completely hangs after few requests from one app to another.

Hosting them on one Virtual Host with different paths seems to solve the problem, and so does disabling requests.

Both apps are Python Flask web servers.

httpd.conf

Listen 80
Listen 3000

ServerName localhost

<VirtualHost *:80>
    WSGIScriptAlias / F:\path\to\server.wsgi

    <Directory F:\path\to>
        Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:3000>
    WSGIScriptAlias / F:\another\path\to\server.wsgi

    <Directory F:\another\path\to>
        Require all granted
    </Directory>
</VirtualHost>

AcceptFilter http none
AcceptFilter https none

Seems that i found the solution:

If you using C modules in your apps then add this line inside VirtualHost

   WSGIApplicationGroup %{GLOBAL}

Slow page loading on apache when using Flask

https://modwsgi.readthedocs.io/en/develop/user-guides/application-issues.html#python-simplified-gil-state-api

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM