1

I was trying to load the wsgi_module into httpd.conf file / redhat:

   ...
   LoadModule wsgi_module modules/mod_wsgi.so

But when i restart the server i get the followeing error:

Starting httpd: httpd: Syntax error on line 201 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_wsgi.so into server: libpython2.5.so: cannot open shared object file: No such file or directory

It is strange because file and directory exists.. Any ideas?

Kreshnik
  • 2,661
  • 5
  • 31
  • 39
  • you intend the permission of: "mod_wsgi.so" ? – Kreshnik Aug 22 '12 at 15:07
  • permission of mod_wsgi.so is 755. – Kreshnik Aug 22 '12 at 15:09
  • Is your mod_wsgi.so installed from a binary package or did you compile it from source code yourself? The answer to your problem depends on which way you did it. Also indicate what version of Python you want mod_wsgi to use and where it is installed on your system. – Graham Dumpleton Aug 23 '12 at 00:53
  • I installed mod_wsgi compiling a source code. The python version is 2.5 and the dir is: "/root/epd-5.1.0/lib/python2.5/". – Kreshnik Aug 23 '12 at 08:32

1 Answers1

2

Your copy of mod_wsgi is compiled against a different version of python than what you have. Looks like it's looking for python version 2.5. If you run python -V on your system, see what version(s) you have installed and try to find a mod_wsgi built against that version (python will output something like 2.7.3, which would be python 2.7).

It's either that or your copy of libpython2.5.so isn't in apache's library path. you could try and symlink it to one of the lib directories in apache's library path, or you can add the directory where your libpython2.5.so resides and add that to apache's library path. This serverfault question has a few answers that might help you set that up.

another good reference: Python executable not finding libpython shared library

Community
  • 1
  • 1
Jon Lin
  • 142,182
  • 29
  • 220
  • 220