mod_wsgi:每个请求多个应用程序调用?
我将 apache 与 mod_wsgi 一起使用,当我启动 apache 并发出请求时,我看到它对应用程序进行了一次调用。几分钟后(应用程序重新加载),现在我看到每个请求对应用程序进行两次调用。这是为什么呢?
另外:是否有任何简单的方法可以使用 wsgi 初始化资源(例如数据库池)?我感觉这很复杂......
这是我的配置:
NameVirtualHost *:80
WSGIPythonPath /Users/blahblah/servercode/
WSGIPythonEggs /Users/blahblah/running/eggs/
<VirtualHost *:80>
ErrorLog /Users/blahblah/running/error.log
LogLevel debug
CustomLog /Users/blahblah/running/access.log combined
ServerSignature On
DocumentRoot /Users/blahblah/wsgi
WSGIScriptAlias /mps.py /Users/blahblah/wsgi/wsgi_connector.wsgi
<Directory /Users/blahblah/wsgi>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I'm using apache with mod_wsgi, and when I start apache and make a request, I see it make one invokation of the application. After a few minutes (the application gets reloaded), and now I see it make two invokations of the application per request. Why's that?
Also: is there any easy way to initialize resources (database pools, for example) with wsgi? I have the feeling it's complicated...
Here's my conf:
NameVirtualHost *:80
WSGIPythonPath /Users/blahblah/servercode/
WSGIPythonEggs /Users/blahblah/running/eggs/
<VirtualHost *:80>
ErrorLog /Users/blahblah/running/error.log
LogLevel debug
CustomLog /Users/blahblah/running/access.log combined
ServerSignature On
DocumentRoot /Users/blahblah/wsgi
WSGIScriptAlias /mps.py /Users/blahblah/wsgi/wsgi_connector.wsgi
<Directory /Users/blahblah/wsgi>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论