[opensuse] apache2-mod_python on 64-bit Tumbleweed
![](https://seccdn.libravatar.org/avatar/8b52a96c17a60eb8befeff5fbbe59cf4.jpg?s=120&d=mm&r=g)
Some python things are installed in /usr/lib/python2.7/site-packages, and others in /usr/lib64/python2.7/site-packages. It seems that if the package contains a binary, it is installed in /usr/lib64, while script-only packages are in /usr/lib If I import a package in the python interpreter, it looks in both places, and all seems well. However, if I try to do the same thing via mod_python in Apache2, it seems only /usr/lib64 is checked. So, a script-only package like Trac is not found. All the packages are from OBS. I cannot see where to tell mod_python to check both of these places. Are there any Apache2 mod_python users out there? -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/f40b6bb0c11cf636430f4602dd67739a.jpg?s=120&d=mm&r=g)
On Jan 10, 2017, at 09:47:10, Roger Oberholtzer <roger.oberholtzer@gmail.com> wrote:
Some python things are installed in /usr/lib/python2.7/site-packages, and others in /usr/lib64/python2.7/site-packages. It seems that if the package contains a binary, it is installed in /usr/lib64, while script-only packages are in /usr/lib
If I import a package in the python interpreter, it looks in both places, and all seems well. However, if I try to do the same thing via mod_python in Apache2, it seems only /usr/lib64 is checked. So, a script-only package like Trac is not found.
All the packages are from OBS.
I cannot see where to tell mod_python to check both of these places. Are there any Apache2 mod_python users out there?
I am not a mod_python user, but it seemed reasonable to me to see if there is a way of modifying the search path via a mod_python directive. There is, and this page should get you started: http://modpython.org/live/current/doc-html/directives.html -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/8b52a96c17a60eb8befeff5fbbe59cf4.jpg?s=120&d=mm&r=g)
On Tue, Jan 10, 2017 at 3:52 PM, Tom Kacvinsky <tom.kacvinsky@suse.com> wrote:
I am not a mod_python user, but it seemed reasonable to me to see if there is a way of modifying the search path via a mod_python directive. There is, and this page should get you started:
I tried adding: PythonPath "['/usr/lib/python2.7/site-packages', '/usr/lib64/python2.7/site-packages']" So the Apache config is: <Location /systems> SetHandler mod_python PythonInterpreter main_interpreter PythonPath "['/usr/lib/python2.7/site-packages', '/usr/lib64/python2.7/site-packages']" PythonHandler trac.web.modpython_frontend PythonOption TracEnv /vol1/trac/systems PythonOption TracUriRoot /systems AuthType Basic AuthName "Systems" AuthUserFile /vol1/trac/access/systems/.htpasswd Require valid-user </Location> It still only looked in /usr/lib64/python2.7/site-packages. The directive seems to be accepted as it shows up for this Location in server-info. But I don't see mod_python using it. The configuration had been working on a 32-bit install where all is in /usr/lib. I'm updating the server to 64-bit, and this issue has arisen. -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/f40b6bb0c11cf636430f4602dd67739a.jpg?s=120&d=mm&r=g)
On Jan 10, 2017, at 10:14:42, Roger Oberholtzer <roger.oberholtzer@gmail.com> wrote:
On Tue, Jan 10, 2017 at 3:52 PM, Tom Kacvinsky <tom.kacvinsky@suse.com> wrote:
I am not a mod_python user, but it seemed reasonable to me to see if there is a way of modifying the search path via a mod_python directive. There is, and this page should get you started:
I tried adding:
PythonPath "['/usr/lib/python2.7/site-packages', '/usr/lib64/python2.7/site-packages']"
So the Apache config is:
<Location /systems> SetHandler mod_python PythonInterpreter main_interpreter PythonPath "['/usr/lib/python2.7/site-packages', '/usr/lib64/python2.7/site-packages']" PythonHandler trac.web.modpython_frontend PythonOption TracEnv /vol1/trac/systems PythonOption TracUriRoot /systems AuthType Basic AuthName "Systems" AuthUserFile /vol1/trac/access/systems/.htpasswd Require valid-user </Location>
It still only looked in /usr/lib64/python2.7/site-packages. The directive seems to be accepted as it shows up for this Location in server-info. But I don't see mod_python using it.
The configuration had been working on a 32-bit install where all is in /usr/lib. I'm updating the server to 64-bit, and this issue has arisen.
I forgot a fundamental aspect of this. The 32 bit modules in /usr/lib/python2.7/site-packages will not load in the 64 bit environment, unless it is pure Python. But I suspect part of what you have in the 32 bit directory is a dynamically loaded 32 bit shared object, which just won't work in a 64 bit environment. A solution to this problem is to rebuild it as a 64 bit module. Not sure if you are grabbing this module from OBS or not. If you are, you'll need to contact the OBS maintainer for this module and get them to build in 64 bit mode. But if you are building from source, you're on your own. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/f40b6bb0c11cf636430f4602dd67739a.jpg?s=120&d=mm&r=g)
On Jan 10, 2017, at 11:17:46, Tom Kacvinsky <tom.kacvinsky@suse.com> wrote:
On Jan 10, 2017, at 10:14:42, Roger Oberholtzer <roger.oberholtzer@gmail.com> wrote:
On Tue, Jan 10, 2017 at 3:52 PM, Tom Kacvinsky <tom.kacvinsky@suse.com> wrote:
I am not a mod_python user, but it seemed reasonable to me to see if there is a way of modifying the search path via a mod_python directive. There is, and this page should get you started:
I tried adding:
PythonPath "['/usr/lib/python2.7/site-packages', '/usr/lib64/python2.7/site-packages']"
So the Apache config is:
<Location /systems> SetHandler mod_python PythonInterpreter main_interpreter PythonPath "['/usr/lib/python2.7/site-packages', '/usr/lib64/python2.7/site-packages']" PythonHandler trac.web.modpython_frontend PythonOption TracEnv /vol1/trac/systems PythonOption TracUriRoot /systems AuthType Basic AuthName "Systems" AuthUserFile /vol1/trac/access/systems/.htpasswd Require valid-user </Location>
It still only looked in /usr/lib64/python2.7/site-packages. The directive seems to be accepted as it shows up for this Location in server-info. But I don't see mod_python using it.
The configuration had been working on a 32-bit install where all is in /usr/lib. I'm updating the server to 64-bit, and this issue has arisen.
I forgot a fundamental aspect of this. The 32 bit modules in
/usr/lib/python2.7/site-packages
will not load in the 64 bit environment, unless it is pure Python. But I suspect part of what you have in the 32 bit directory is a dynamically loaded 32 bit shared object, which just won't work in a 64 bit environment.
A solution to this problem is to rebuild it as a 64 bit module.
Not sure if you are grabbing this module from OBS or not. If you are, you'll need to contact the OBS maintainer for this module and get them to build in 64 bit mode. But if you are building from source, you're on your own.
Oh yeah, there has got to be either an apache log or a mod_python log that will tell you if it is having problems dlopen-ing a file (this is the dynamically loading process I was talking about). -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/8b52a96c17a60eb8befeff5fbbe59cf4.jpg?s=120&d=mm&r=g)
Roger
I forgot a fundamental aspect of this. The 32 bit modules in
/usr/lib/python2.7/site-packages
mod_python is a 64-bit module. It's in /usr/lib64. The thing I want to load (trac) is pure python and is in /usr/lib The OS install is totally new. I don't expect there to be any 32-bit stuff lurking around. I will verify this when I get to the office tomorrow. All binaries are from OBS. The python scripts are obtained by easy_install (from setuptools from OBS).
Oh yeah, there has got to be either an apache log or a mod_python log that will tell you if it is having problems dlopen-ing a file (this is the dynamically loading process I was talking about).
It says that it cannot find trac in /usr/lib64. It never seems to look in /usr/lib. Or at least it is not mentioned in the log. But it's in the Apache config as I see it in server-info If I "import trac" in a python shell, it works. So I think trac is correctly installed. -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/7891b1b1a5767f4b9ac1cc0723cebdac.jpg?s=120&d=mm&r=g)
Roger Oberholtzer wrote:
Some python things are installed in /usr/lib/python2.7/site-packages, and others in /usr/lib64/python2.7/site-packages. It seems that if the package contains a binary, it is installed in /usr/lib64, while script-only packages are in /usr/lib
If I import a package in the python interpreter, it looks in both places, and all seems well. However, if I try to do the same thing via mod_python in Apache2, it seems only /usr/lib64 is checked. So, a script-only package like Trac is not found.
All the packages are from OBS.
I cannot see where to tell mod_python to check both of these places. Are there any Apache2 mod_python users out there?
(not TW). I use it for mailman, but that's all in /usr/lib/mailman/. -- Per Jessen, Zürich (1.5°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/7891b1b1a5767f4b9ac1cc0723cebdac.jpg?s=120&d=mm&r=g)
Per Jessen wrote:
Roger Oberholtzer wrote:
Some python things are installed in /usr/lib/python2.7/site-packages, and others in /usr/lib64/python2.7/site-packages. It seems that if the package contains a binary, it is installed in /usr/lib64, while script-only packages are in /usr/lib
If I import a package in the python interpreter, it looks in both places, and all seems well. However, if I try to do the same thing via mod_python in Apache2, it seems only /usr/lib64 is checked. So, a script-only package like Trac is not found.
All the packages are from OBS.
I cannot see where to tell mod_python to check both of these places. Are there any Apache2 mod_python users out there?
(not TW).
I use it for mailman, but that's all in /usr/lib/mailman/.
We're not using mod_python, sorry about the noise. -- Per Jessen, Zürich (1.9°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/8b52a96c17a60eb8befeff5fbbe59cf4.jpg?s=120&d=mm&r=g)
Problem solved. It seems mod_python does not recognize .egg files. They must be unpacked into a directory. In my case, when I installed Trac, I needed to do: easy_install --always-unzip Trac The Python interpreter, on the other hand, is happy with .egg files. I wonder if this is a compile option to mod_python. Maybe there is a good reason not to support .egg files in that context? -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (3)
-
Per Jessen
-
Roger Oberholtzer
-
Tom Kacvinsky