我正在使用带有mod_wsgi的apache,当我启动apache并发出请求时,我看到它会对应用程序进行一次调用。几分钟后(应用程序重新加载),现在我看到它为每个请求发出两次应用程序调用。为什么?
另外:有没有简单的方法用wsgi初始化资源(例如数据库池)?我觉得这很复杂......
这是我的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>