Cannot load mod_wsgi.so into server: undefined symbol: ap_null_cleanup

143 views
Skip to first unread message

Chris O.

unread,
Jun 30, 2016, 3:35:33 PM6/30/16
to modwsgi
(Just as a warning, I might not have any idea what I'm doing.)
I don't think this is relevant, but I'm trying to use mod_wsgi because I'm using a Bottle application on an Apache server, and it seems the only way to do that without Bottle starting its own server is by using mod_wsgi.

System I'm using: Linux version 2.6.32-573.12.1.el6.x86_64 (gcc version 4.4.4 (Red Hat 4.4.7-16)) Red Hat Enterprise Linux Server release 6.8 (Santiago)

So I downloaded mod_wsgi 3.5 from GitHub, installed it into the Apache modules directory (Apache 2.2.15 Unix), and set the LD_LIBRARY_PATH so it stopped telling me it couldn't find the shared libpython thing (I wouldn't think it would be the cause of my current problem, but I can redo it and set the proper run path later). Now, though, I get the line "httpd: Syntax error on line 105 of .../httpd.conf: Cannot load .../modules/mod_wsgi.so into server: .../modules/mod_wsgi.so: undefined symbol: ap_null_cleanup" when trying to restart the Apache server. Any ideas?

In the event that this is certainly because I'm missing the dev packages of Apache or Python, would you be able to show me where I can find them? I have no idea if this system has the dev packages and I do not where I would go to download them (maybe I just haven't been looking hard enough though).

Thanks,
~Chris O.

Graham Dumpleton

unread,
Jun 30, 2016, 7:10:04 PM6/30/16
to mod...@googlegroups.com
On 30 Jun 2016, at 12:34 PM, Chris O. <christo...@gmail.com> wrote:

(Just as a warning, I might not have any idea what I'm doing.)
I don't think this is relevant, but I'm trying to use mod_wsgi because I'm using a Bottle application on an Apache server, and it seems the only way to do that without Bottle starting its own server is by using mod_wsgi.

System I'm using: Linux version 2.6.32-573.12.1.el6.x86_64 (gcc version 4.4.4 (Red Hat 4.4.7-16)) Red Hat Enterprise Linux Server release 6.8 (Santiago)

So I downloaded mod_wsgi 3.5 from GitHub,

The latest version of mod_wsgi is version 4.5.3. Is there a specific reason you are using such an old mod_wsgi version? It is over 20 versions behind.

installed it into the Apache modules directory (Apache 2.2.15 Unix),

How did you install it? Were you using the traditional ‘configure/make/make install’ method.

Which version of Python are you using? Are you using Python from Software Collections?

You should not use the system Python on RHEL as it is old.

and set the LD_LIBRARY_PATH so it stopped telling me it couldn't find the shared libpython thing (I wouldn't think it would be the cause of my current problem, but I can redo it and set the proper run path later).

Where were you setting LD_LIBRARY_PATH? What were you doing when you were seeing the error that suggested you need to set this.

One cannot set LD_LIBRARY_PATH in your user environment and have it affect Apache. Setting LD_LIBRARY_PATH isn’t the recommended way when using mod_wsgi of handling shared libraries in non standard locations such as occurs with Software Collections version of Python. There is a better way of ensuring mod_wsgi can find the correct Python library at run time.

Now, though, I get the line "httpd: Syntax error on line 105 of .../httpd.conf: Cannot load .../modules/mod_wsgi.so into server: .../modules/mod_wsgi.so: undefined symbol: ap_null_cleanup" when trying to restart the Apache server. Any ideas?

In the event that this is certainly because I'm missing the dev packages of Apache or Python, would you be able to show me where I can find them? I have no idea if this system has the dev packages and I do not where I would go to download them (maybe I just haven't been looking hard enough though).

Where is Apache coming from? Are you trying to use that from Software Collections as well?

This looks a little bit like a mix up of Apache versions. That is, the Apache version you are running, is different to what Apache headers files are being found.

Thanks,
~Chris O.

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Chris O.

unread,
Jun 30, 2016, 9:44:38 PM6/30/16
to modwsgi
The reason I'm using an old mod_wsgi version may be related to the possible mixup of Apache versions. Because I've been using mostly absolute path names, I had forgotten that I was using /usr/sbin/apachectl (which is Apache 2.2.15) because the default, /usr/local/bin/apachectl (which is actually Apache 1.3.34), says "fopen: Read-only file system" when I try to restart it (I'm guessing I don't have permissions to that). I don't know if there is a way to tell mod_wsgi which one I want it in, but trying to install it as is says "

Sorry, mod_wsgi 4.0+ requires Apache 2.0+."



To install mod_wsgi 3.5, I did use configure (I specified Python 2.7.8) and make, but make install gave me some kind of trouble, so I moved the mod_wsgi.so into the same directory all the other Apache modules were in manually. I don't remember if it was the same message, but doing "make install" again gave this: "

/usr/local/bin/apxs -i -S LIBEXECDIR=/usr/local/apache/1.3.34/libexec -n 'mod_wsgi' mod_wsgi.so

cp mod_wsgi.so /usr/local/apache/1.3.34/libexec/mod_wsgi.so

cp: cannot create regular file `/usr/local/apache/1.3.34/libexec/mod_wsgi.so': Read-only file system

apxs:Break: Command failed with rc=1

make: *** [install] Error 1   " Again, I'm guessing it's because I don't have the permissions for the "default" Apache.



I wish I could tell you where the Python is from, but I did not set it up and do not know how to determine that. I can tell you that the default /usr/bin/python tells me "Python 2.4.1 (#1, Aug 28 2006, 09:46:19) 

[GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2", but the Python I've been using for everything from my virtual environment says "Python 2.7.8 (default, Jul 24 2014, 11:51:04) 

[GCC 4.6.1] on linux2"



I had set LD_LIBRARY_PATH because I had been getting this when trying to restart the server: "httpd: Syntax error on line 105 of /export/software/www/config/conf/httpd.conf: Cannot load /export/software/www/config/modules/mod_wsgi.so into server: libpython2.7.so.1.0: cannot open shared object file: No such file or directory". After I had set it, trying to restart gave me the "ap_null_cleanup" thing, so I had assumed it did something.

 

My answer to where the Apache came from is the same as where the Python came from. I really just don't know.

Graham Dumpleton

unread,
Jul 1, 2016, 12:25:08 AM7/1/16
to mod...@googlegroups.com
On 30 Jun 2016, at 6:44 PM, Chris O. <christo...@gmail.com> wrote:

The reason I'm using an old mod_wsgi version may be related to the possible mixup of Apache versions. Because I've been using mostly absolute path names, I had forgotten that I was using /usr/sbin/apachectl (which is Apache 2.2.15) because the default, /usr/local/bin/apachectl (which is actually Apache 1.3.34), says "fopen: Read-only file system" when I try to restart it (I'm guessing I don't have permissions to that). I don't know if there is a way to tell mod_wsgi which one I want it in, but trying to install it as is says

Don’t use Apache 1.3. That Apache 1.3 version you have installed appears to have been installed from source code as system package wouldn’t be installed there, nor would system collections.

Sorry, mod_wsgi 4.0+ requires Apache 2.0+."

To install mod_wsgi 3.5, I did use configure (I specified Python 2.7.8) and make, but make install gave me some kind of trouble, so I moved the mod_wsgi.so into the same directory all the other Apache modules were in manually. I don't remember if it was the same message, but doing "make install" again gave this: "

/usr/local/bin/apxs -i -S LIBEXECDIR=/usr/local/apache/1.3.34/libexec -n 'mod_wsgi' mod_wsgi.so

cp mod_wsgi.so /usr/local/apache/1.3.34/libexec/mod_wsgi.so

cp: cannot create regular file `/usr/local/apache/1.3.34/libexec/mod_wsgi.so': Read-only file system

apxs:Break: Command failed with rc=1

make: *** [install] Error 1   " Again, I'm guessing it's because I don't have the permissions for the "default" Apache.

I wish I could tell you where the Python is from, but I did not set it up and do not know how to determine that. I can tell you that the default /usr/bin/python tells me "Python 2.4.1 (#1, Aug 28 2006, 09:46:19) 

[GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2", but the Python I've been using for everything from my virtual environment says "Python 2.7.8 (default, Jul 24 2014, 11:51:04) 

[GCC 4.6.1] on linux2"


What do you get when you run:

    which python

Python 2.7.8 looks a bit like it might be from software collections.

Do you user account shell profile scripts that references ‘scl_enable’? If yes what is the command it runs.

I had set LD_LIBRARY_PATH because I had been getting this when trying to restart the server: "httpd: Syntax error on line 105 of /export/software/www/config/conf/httpd.conf: Cannot load /export/software/www/config/modules/mod_wsgi.so into server: libpython2.7.so.1.0: cannot open shared object file: No such file or directory". After I had set it, trying to restart gave me the "ap_null_cleanup" thing, so I had assumed it did something.

My answer to where the Apache came from is the same as where the Python came from. I really just don't know

What do you get when you run:

    echo $LD_LIBRARY_PATH

What do you get when you run:

    which apxs

and:

    which apxs2

Graham

Graham Dumpleton

unread,
Jul 1, 2016, 12:27:58 AM7/1/16
to mod...@googlegroups.com
Whoops, is probably 'scl enable’ you need to look for.

For information about what the command is I am looking for see:

If you are using RHEL, you should really learn about software collections and ensure you are using them so as to get newer versions of packages.


Graham

Chris O.

unread,
Jul 1, 2016, 12:11:22 PM7/1/16
to modwsgi
Good news; I hadn't completely understood the --with-apxs flag's purpose, but setting that to use /usr/local/apache2/2.2.14/bin/apxs and moving mod_wsgi.so into the right place has stopped giving an error when restarting Apache (using mod_wsgi 4.5.3). Hopefully, configuring everything to use it will go smoothly.


I'll still answer the rest of your questions though. If I do not set my $PATH, `which python` yields "/usr/local/bin/python" (the 2.4.1 one). (I set my $PATH to use the 2.7.8 one, which is at /export/software/Summer2016/bin/python.)

I don't see anything about scl, and I can't use it as a command.


Just doing `echo LD_LIBRARY_PATH` gives "LD_LIBRARY_PATH: Undefined variable. " 
I have been doing `setenv LD_LIBRARY_PATH /usr/local/python/2.7.8/lib` to let it find libpython2.7.so.1.0 .


`which apxs` gives /usr/local/bin/apxs
`which apxs2` gives apxs2: Command not found.


Here's hoping I don't run into any more problems. Thank you for your help, Graham, I really appreciate it.

~Chris O.
Reply all
Reply to author
Forward
0 new messages