Compiling mod_wsgi on a 64 bit machine with 32 bit Apache, 64 bit Python

548 views
Skip to first unread message

ustunozgur

unread,
Jan 24, 2011, 4:40:33 PM1/24/11
to modwsgi
I am trying to install mod_wsgi for deploying a django project on a
client's machine, unfortunately however the client's configuration is
*silly* (I'm trying to find the politest term) and I'm having a hard
time installing mod_wsgi module.

Here are the currently installed software:

- Opensuse 10.2 x86-64 (not supported at the moment, but I have been
to find a repo)
- They installed their current server using xampp (This is a nonsecure
lampp distribution mainly for windows folks, but for some reason they
decided to install this in /opt) : 32 bits I guess (I did ldd on the
modules, and no 64 bit stuff came)
- Python: 64 bits, but there is a package python-32bit which I guess
installs some 32 bit libraries (no 32 bit binaries though)

Now, with some luck, I have actually been able to somehow install
virtualenv, django etc. and development server built in Django works.
The final task was installing mod_wsgi.

1. I downloaded mod_wsgi, xampp's dev, prefixed ./configure --with-
apxs=/opt/lamp/apache/bin/apxs and it compiled. I copied the mod_wsgi
into /opt/lampp/modules directory, added a WSGI line in httpd.conf and
restarted the apache server.

The error was: "httpd: Syntax error on line 125 of /opt/lampp/etc/
httpd.conf: Cannot load /opt/lampp/modules/mod_wsgi.so into server: /
opt/lampp/modules/mod_wsgi.so: wrong ELF class: ELFCLASS64"

2. I edited the Makefile so that /usr/lib64 was /usr/lib, hoping to
get a 32 bit one. Still the same error.

3. I have a 32-bit Ubuntu machine, with python2.6 installed. I
compiled the module, copied to the SuSe machine, I ldd'd the module,
saw that it required /lib/libpython2.6, made a soft link to
libpython2.6 from libpython2.5, restarted Apache, this time Apache
loaded, however the site didn't respond and in the error.log; it said
something like "import os" no module named os.


So, is there any way to compile mod_wsgi as a 32 bit module that can
interact with the 64-bit python? Or any other way to get around this
issue? They don't want to replace xampp as it might *break* things.

Kind regards,

Ustun



Graham Dumpleton

unread,
Jan 24, 2011, 5:21:04 PM1/24/11
to mod...@googlegroups.com

The mod_wsgi.so is compiled against a specific Python
version/installation. You can't just go swapping the library like that
as it will fail.

> So, is there any way to compile mod_wsgi as a 32 bit module that can
> interact with the 64-bit python?

No.

> Or any other way to get around this issue?

No.

Could you install a 32 bit Python in a non standard location, eg
/usr/local, and compile against that instead?

Graham

ustunozgur

unread,
Jan 25, 2011, 6:05:18 AM1/25/11
to modwsgi
On Jan 25, 12:21 am, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
Thanks Graham, installing 32 bit Python seemed daunting and I have
convinced them to migrate to the 64 bit Apache server instead. Problem
solved.

Ustun

Graham Dumpleton

unread,
Jan 25, 2011, 6:11:17 AM1/25/11
to mod...@googlegroups.com
On 25 January 2011 22:05, ustunozgur <ustun...@gmail.com> wrote:
> Thanks Graham, installing 32 bit Python seemed daunting and I have
> convinced them to migrate to the 64 bit Apache server instead. Problem
> solved.

But you haven't done it yet?

Hopefully it will work and we wont have egg on our face. :-)

Graham

ustunozgur

unread,
Jan 25, 2011, 7:04:53 AM1/25/11
to modwsgi
On Jan 25, 1:11 pm, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
> On 25 January 2011 22:05, ustunozgur <ustunoz...@gmail.com> wrote:
>
> > Thanks Graham, installing 32 bit Python seemed daunting and I have
> > convinced them to migrate to the 64 bit Apache server instead. Problem
> > solved.
>
> But you haven't done it yet?
>
> Hopefully it will work and we wont have egg on our face. :-)
>

Yes, I have migrated already and everything works. :) I showed your
post to them as a proof of necessity to migrate.

Ustun
Reply all
Reply to author
Forward
0 new messages