Error building on MacOS

19 views
Skip to first unread message

Gnarlodious

unread,
Feb 7, 2023, 2:00:14 AM2/7/23
to modwsgi
I ran:
./configure --with-python=/opt/local/bin/python --with-apxs=/opt/local/bin/apxs

...which points to Python3.9 in Xcode.

I said make and got errors at the end with no build file:
ld: warning: directory not found for option '-L/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/config'
ld: warning: -undefined dynamic_lookup may not work with chained fixups


There is a folder at
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9
...but no config folder inside it.

This is MacOS 13.1

What's the next step?

-- Gnarlie

Graham Dumpleton

unread,
Feb 7, 2023, 2:09:10 AM2/7/23
to mod...@googlegroups.com
You can't use configure/make/make install (CMMI) method to install on macOS if is system Apache httpd as Apple supplied Apache httpd is broken. Installing from upstream Apache httpd source code also will not work. You need to install Apache httpd using Homebrew and use that instead if want to use CMMI method.

As to Python, Apple supplied Apache is not under /opt/local so somewhat doubt that is Xcode version.

Either way, you can try using "pip install mod_wsgi" method instead. See:

 
This should work, although do note that latest macOS versions block you running third party Apache module, so your only choice is to use mod_wsgi-express instead and you can't manually configure Apache using the module it builds.

Using HomeBrew Apache avoids the macOS restrictions on third party Apache modules as well.

Graham

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/b3d3caea-1101-4b3e-9989-484f6ba511e2n%40googlegroups.com.

Gnarlodious

unread,
Feb 7, 2023, 11:39:34 AM2/7/23
to modwsgi

Okay, it looks like I installed Macports Apache, since Homebrew has given me such trouble in the past. They also have mod_wsgi: https://ports.macports.org/port/mod_wsgi/details/ but it says unverified for ARM64 processor. Will give it a try and report back if it works

-- Gnarlie

Gnarlodious

unread,
Feb 7, 2023, 4:48:55 PM2/7/23
to modwsgi
So I installed the MacPorts mod_wsgi which was pretty simple and works well. Unfortunately the MacPorts Apache has the default compiled-in MPM of "prefork", which causes my WSGI sessions to expire after about 10 seconds. Looks like I will need to download the Apache installer and build it with the "worker" MPM to get mod_wsgi to behave like I want.

-- Gnarlie

Graham Dumpleton

unread,
Feb 7, 2023, 4:53:29 PM2/7/23
to mod...@googlegroups.com
It may have default prefork configured, but you should be able to dynamically override that through configuration to either worker or event MPM. The only time you wouldn't is if they static compiled all Apache modules in, which is not usually done and would be pretty stupid on their part if they are.

Look for LoadModule mpm_prefork_module line and see if alternatives are commented out for other MPMs and just change which is used.

Graham

Gnarlodious

unread,
Feb 8, 2023, 1:42:10 AM2/8/23
to modwsgi
There isn't any worker or event module included with the MacPorts Apache, and prefork is compiled in. Meanwhile mod_wsgi is working well enough as it is, maybe sometime later I will try to build a custom Apache.

Thanks.

-- Gnarlie

Graham Dumpleton

unread,
Feb 8, 2023, 1:49:07 AM2/8/23
to mod...@googlegroups.com
As I already said, you can't build Apache httpd from source code yourself on macOS. The APR library it uses will not build on macOS and they haven't made a release for so many years it has never been fixed. HomeBrew and MacPorts would patch it to get it to compile and I am not clear on what the patch is.

Overall I would suggest ditching MacPorts. It has always been inferior to HomeBrew and has always caused lots of problems for mod_wsgi because their Python distro is often broken and can't build embedded applications properly. Seems their Apache httpd is also inferior as well.

Graham

Message has been deleted
Message has been deleted

Gnarlodious

unread,
Feb 8, 2023, 10:15:41 AM2/8/23
to modwsgi
I was able to re-install with compiled-in worker MPM with command:
sudo port install apache2 +workermpm

Note there is no mention of this option on the instruction page:

Now all is working as intended! Hope this info helps someone!

-- Gnarlie
Reply all
Reply to author
Forward
0 new messages