如何使MOD_WSGI应用程序以32位模式运行Python?

如何使MOD_WSGI应用程序以32位模式运行Python?,python,32bit-64bit,mod-wsgi,cherrypy,Python,32bit 64bit,Mod Wsgi,Cherrypy,我似乎尝试了所有方法,但未能实现在32位模式下运行Python 我的情况如下: 我正在运行OSX 10.8。我开发的CherryPy应用程序必须连接到Oracle 10g2数据库。有一个众所周知的问题是,CX_Oracle无法在64位中工作,因此需要在32位中运行 <IfModule wsgi_module> <Directory "/Library/WebServer/WSGI-Executables"> AllowOverride None Options None

我似乎尝试了所有方法,但未能实现在32位模式下运行Python

我的情况如下:

我正在运行OSX 10.8。我开发的CherryPy应用程序必须连接到Oracle 10g2数据库。有一个众所周知的问题是,CX_Oracle无法在64位中工作,因此需要在32位中运行

<IfModule wsgi_module> 
<Directory "/Library/WebServer/WSGI-Executables">
AllowOverride None
Options None FollowSymLinks
Order allow,deny
Allow from all
SetEnv CONFIG_PATH /Users/bioffe/src/Icap/trunk/cgi-bin
SetEnv ORACLE_HOME /Applications/ORACLE/instantclient_10_2
SetEnv TNS_ADMIN /Applications/ORACLE/instantclient_10_2
SetEnv LD_LIBRARY_PATH /Applications/ORACLE/instantclient_10_2
SetEnv DYLD_LIBRARY_PATH /Applications/ORACLE/instantclient_10_2
SetEnv VERSIONER_PYTHON_PREFER_32_BIT yes

</Directory>
WSGIPythonHome  /usr/local/bin/python2.7-32
WSGIPythonPath /Library/WebServer/WSGI-Executables
WSGIScriptAlias /etc  /Library/WebServer/WSGI-Executables/ETCConfWebApp.py
#WSGIDaemonProcess etc_config user=bioffe group=wheel threads=4 python_path=/Library/Python/2.7/site-packages/
ProxyPreserveHost On
SetEnv VERSIONER_PYTHON_PREFER_32_BIT yes

</IfModule>
输出

PATH=/usr/bin:/bin:/usr/sbin:/sbin
**********
Current Dir = /Library/WebServer/WSGI-Executables 
__file__ = /Library/WebServer/WSGI-Executables/ETCConfWebApp.py 
PID=16170 
PPID=16167 
UID=70 
ThreadID=140735313402208 name=MainThread 
ThreadPool Size=10 
ThreadPool Max Size=-1 
2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] 
9223372036854775807 <- 64 bit, I want to see 32-bit's 2147483647 
我看到使用UID bioffe运行的额外https进程,但是我的应用程序仍然由使用UID的httpd进程处理。为什么我的请求由不同的httpd进程处理

你读过:

还要注意SetEnv不设置环境变量。对于mod_wsgi,它设置每个请求的环境变量,这些变量在每个请求时通过字典传递给wsgi应用程序。因此,您不能设置env来设置流程环境变量

至于WSGIDaemonProcess,您可能缺少所需的WSGIProcessGroup

请确保您正在阅读mod_wsgi官方网站上的mod_wsgi文档,因为这些详细信息都包含在其中

你可能有一些其他的错误,但太难说,因为没有提供细节,这将有助于确认这一点

PATH=/usr/bin:/bin:/usr/sbin:/sbin
**********
Current Dir = /Library/WebServer/WSGI-Executables 
__file__ = /Library/WebServer/WSGI-Executables/ETCConfWebApp.py 
PID=16170 
PPID=16167 
UID=70 
ThreadID=140735313402208 name=MainThread 
ThreadPool Size=10 
ThreadPool Max Size=-1 
2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] 
9223372036854775807 <- 64 bit, I want to see 32-bit's 2147483647 
WSGIDaemonProcess etc_config user=bioffe group=wheel threads=4 python_path=/Library/Python/2.7/site-packages/