我有以下配置:
虚拟主机:
<VirtualHost *:80>
ServerAdmin rok@localhost
ServerName lh.test.com
WSGIScriptAlias / /home/user/myapp/src/wsgi.py application-group='%{GLOBAL}' process-group='%{GLOBAL}'
WSGIDaemonProcess lh.test.com processes=1 threads=1 display-name=%{GROUP}
<Directory /home/user/myapp/src>
<Files wsgi.py>
Order deny,allow
Require all granted
</Files>
Options All
AllowOverride All
Require all granted
</Directory>
Alias /static /home/user/myapp/src/static
ErrorLog /var/log/apache2/lh.test.com-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog /var/log/apache2/lh.test.com-access.log combined
</VirtualHost>
wsgi.py:
from __future__ import unicode_literals
import os, signal, sys
sys.path.append('/home/user/apps/django-trunk')
sys.path.insert(0, '/home/user/myapp/src')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")
print 'starting up wsgi application...'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
当我启动Apache时,开头总是出于某种原因两个相同的wsgi进程:
Apache日志:
Mon Jan 06 21:17:02.895219 2014] [mpm_event:notice] [pid 27628:tid 140594224048000] AH00489: Apache/2.4.6 (Ubuntu) mod_wsgi/3.4 Python/2.7.5+ configured -- resuming normal operations
[Mon Jan 06 21:17:02.895287 2014] [core:notice] [pid 27628:tid 140594224048000] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 06 21:17:02.905771 2014] [:error] [pid 27632:tid 140594224048000] starting up wsgi application...
[Mon Jan 06 21:17:02.909542 2014] [:error] [pid 27633:tid 140594224048000] starting up wsgi application...
和ps AUX:
root 27628 0.0 0.0 84196 3100 ? Ss 21:17 0:00 /usr/sbin/apache2 -k start
www-data 27632 0.1 0.3 470984 24648 ? Sl 21:17 0:00 /usr/sbin/apache2 -k start
www-data 27633 0.1 0.3 470984 24648 ? Sl 21:17 0:00 /usr/sbin/apache2 -k start
任何想法,为什么是这样?