Ubuntu9.04默认的Python版本是2.6的,为了安装repoze.plone,就又安装了Python2.4;
用 virtualenv --python=python2.4 --no--site-pachages /datarepos/plone3/
python 创建了虚拟环境,然后执行
/datarepos/plone3/python/bin/easy_install 安装了repoze.plone,repoze.plone安
装完成后,配置好Apache2+mod_wsgi,配置文件如下:
zope2.wsgi:
import os
from paste.deploy import loadapp
ini = '/datarepos/plone3/python/etc/zope2.ini'
application = loadapp('config:%s' % ini)
Apache2.conf:
WSGIPythonHome /datarepos/plone3/python
WSGIDaemonProcess tmp threads=1 processes=4 maximum-requests=10000
python-path=/datarepos/plone3/python/lib/python2.4/site-packages
<VirtualHost *:80>
ServerName wiki.inc.tech
ErrorLog /var/log/apache2/plone_error.log
#LogLevel info
CustomLog /var/log/apache2/plone_access.log combined
WSGIScriptAlias /site /datarepos/plone3/python/bin/zope2.wsgi
WSGIProcessGroup tmp
WSGIPassAuthorization On
SetEnv HTTP_X_VHM_HOST
http://wiki.inc.tech/site
SetEnv PASTE_CONFIG /datarepos/plone3/python/etc/zope2.ini
</VirtualHost>
查看log文件发现运行出错,然后我修改了zope2.wsgi文件:
import sys
def application(environ, start_response):
status = '200 OK'
output = sys.version
# output = str(sys.path)
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
发现sys.version显示是还是Python2.6,看资料WSGIPythonHome /datarepos/plone3/python
就是指定WSGI的python的运行环境的,怎么没有起作用?
请各位给我指指我的问题;