2012-10-17 40 views
8

Tôi đang triển khai ứng dụng web.py của mình trên Apache2 với mod_wsgi.WSGIPythonPath không hoạt động

Đây là tập tin virt_host tôi,

WSGIPythonPath /home/ubuntu/plotwatt/libplotwatt:/home/ubuntu/plotwatt/pwstage/src 

<VirtualHost *:20108> 
ServerAdmin gslabrails.dev.plotwatt.com 

DocumentRoot /var/www 
WSGIScriptAlias//var/www/currentcost/server.py 
WSGIDaemonProcess currentcost user=ubuntu group=ubuntu processes=5 threads=3 
WSGIProcessGroup currentcost 
WSGIApplicationGroup %{GLOBAL} 
AddType text/html .py 

<Directory /var/www/currentcost/> 
    Order deny,allow 
    Allow from all 
</Directory> 

ErrorLog /var/log/apache2/currentcost_error.log 
# Possible values include: debug, info, notice, warn, error, crit, 
# alert, emerg. 
LogLevel warn 

CustomLog /var/log/apache2/currentcost_access.log combined 

</VirtualHost> 

tôi đã đưa đường dẫn đến thư mục lib của tôi tên là redisStage trong WSGIPythonPath. Nhưng, nó có vẻ không hiệu quả với tôi. Tôi có cấu hình sai không? Tôi không thể đặt chỉ thị WSGIPythonPath bên trong chỉ thị VitualHost. Điều gì phải là lý do?

Trả lời

13

Theo the docs, bạn không thể sử dụng WSGIPythonPath khi sử dụng chế độ daemon. Sử dụng tùy chọn 'python-path' cho số WSGIDaemonProcess directive thay thế.

+0

lưu ý tương tự dành cho django và [chế độ daemon modwsgi] (https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/#daemon-mode) –