Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installed mod_wsgi with Apache 2.4.25 - Cannot load /usr/lib64/httpd/modules/mod_wsgi.so into server: /usr/lib64/httpd/modules/mod_wsgi.so: undefined symbol: ap_accept_lock_mech #237

Closed
ohaya opened this issue Nov 8, 2017 · 1 comment

Comments

@ohaya
Copy link

ohaya commented Nov 8, 2017

Hi,

I am trying to install mod_wsgi into an Apache 2.4.25 instance and when I try to start the Apache I am getting this error:

Cannot load /usr/lib64/httpd/modules/mod_wsgi.so into server: /usr/lib64/httpd/modules/mod_wsgi.so: undefined symbol: ap_accept_lock_mech

This Apache is built from source:

[root@apache1 bin]# ./httpd -V
Server version: Apache/2.4.25 (Unix)
Server built: Jan 29 2017 19:56:21
Server's Module Magic Number: 20120211:67
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/apps/apache"
-D SUEXEC_BIN="/apps/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

The OS is Centos 6.8 (64 bit). The original Python was 2.6.6, I believe, but I also have Python 3.6.3 built from source.

The mod_wsgi I currently have on the machine was installed using "yum install mod_wsgi" and is:

[root@apache1 bin]# rpm -qa | grep wsgi
mod_wsgi-3.2-7.el6.x86_64

Should that mod_wsgi work with the Apache 2.4.25?

FYI, I have also been spending quite a lot of time trying to build the mod_wsgi from source (from mod_wsgi-4.5.20.tar.gz). I don't know if I am doing those build attempts (there have been many) are correct or not, but mostly I end up with that same error.

I have also tried re-building Apache from source, to change the MPM to MPM worker, but end up with the same error (per the Subject), so I have restored my dev environment back to the original source-built Apache 2.4.25 and the yum installed mod_wsgi (which is still giving me the same error :)).

Any idea how I can get mod_wsgi working on this Apache?

Thanks,
Jim

@GrahamDumpleton
Copy link
Owner

Coming from:

You need to build mod_wsgi from source code against the newer Apache version you are using. You cannot copy the mod_wsgi.so file from the yum package.

The east thing to do is use the pip install method.

That is, ensure apxs from Apache version you want to use is in PATH. Ensure that Python version you want to use is in PATH, along with pip program from that version.

Run:

pip install mod_wsgi

If you are only doing development, you can at that point skip setting up system Apache and just use mod_wsgi-express start-server.

If do want to use to use system Apache so have permanent site, run:

mod_wsgi-express module-config

That will output what configuration should should add to the Apache configuration files.

For more details see the page for mod_wsgi on PyPi above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants