我在部署项目时遇到了麻烦。使用django deve服务器一切运行正常,但我使用mod_wsgi得到了错误404。这是我的配置文件
django.wsgi
import os
import sys
import django.core.handlers.wsgi
sys.path.append('/home/facundo/BLPServicios/blpservicios')
os.environ['DJANGO_SETTINGS_MODULE'] = 'blpservicios.settings'
application = django.core.handlers.wsgi.WSGIHandler()
blpservicios.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName blpservicios.com
DocumentRoot /home/facundo/Escritorio/BLPServicios/blpservicios
# mod_wsgi settings
WSGIDaemonProcess blpservicios python-path=/home/facundo/Escritorio/BLPServ$
WSGIProcessGroup blpservicios
WSGIScriptAlias / /home/facundo/Escritorio/BLPServicios/blpservicios/apache$
# Static file alias so static files can be referenced by /static/
Alias /static/ /home/facundo/Escritorio/BLPServicios/blpservicios/static/
# Static files permissions
# Used for serving static files.
<Directory /home/facundo/Escritorio/BLPServicios/blpservicios/static/>
Order deny,allow
Allow from all
</Directory>
# Project wsgi permissions
# Used for serving django pages.
<Directory /home/facundo/Escritorio/BLPServicios/blpservicios/static/>
<Files django.wsgi>
Order deny,allow
Allow from all
</Files>
</Directory>
# Project wsgi permissions
# Used for serving django pages.
<Directory /home/facundo/Escritorio/BLPServicios/blpservicios/static/>
<Files django.wsgi>
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>
激活网站a2ensite blpservicios.conf
并且没有发生,这是Apache错误日志:
[Fri Jul 19 10:24:04 2013] [notice] caught SIGTERM, shutting down
[Fri Jul 19 10:24:05 2013] [warn] mod_wsgi: Compiled for Python/2.7.3.
[Fri Jul 19 10:24:05 2013] [warn] mod_wsgi: Runtime using Python/2.7.4.
[Fri Jul 19 10:24:05 2013] [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.4 Python/2.7.4 configured -- resuming normal operations