-
Notifications
You must be signed in to change notification settings - Fork 270
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
Anaconda, mod_wsgi and arm64 architecture #900
Comments
On macOS you cannot use the system supplied Apache httpd, or even build Apache httpd yourself from ASF (Apache Software Foundation) source code, as the APR libraries distributed by the ASF don't support the last few macOS versions and have not done so for quite a while. Your only option on macOS is to use Apache httpd from HomeBrew and use gcc from HomeBrew as well, ignoring the system macOS versions. |
On top of that, you also can't use macOS supplied version of Apache httpd due to the code signing issues where they require Apache modules to be signed. I don't know what is required to sign the module once compiled and no one has been able to explain it to me either. |
Yeah, many thanks. I've gone through several tutorials re: signing modules, but modifying the generated httpd.conf to add the certificate name after the module in the LoadModule command is simply not recognised. (I get the same not signed error.) I'm also curious to know where my original mod_wsgi arm64 python wheel came from in the first place. If I try to reinstall with --no-cache-dir I get the following...
|
If you can, avoid using Anaconda Python. They keep breaking the ability to embed Python in other applications and even if you can get it to build, not guaranteed it will work. Thus also suggest using Python from HomeBrew. Am not really sure why getting the error with Anaconda Python, but do be aware you are using a quite old version of it, ie., Python 3.8. Are you able to at least update to newer Anaconda Python? |
Incidentally mod_wsgi works fine on my old Intel Mac, which is also running MacOS Sonoma! Is it possible to get my Mac to defer to using my homebrew install of httpd and gcc when installing mod_wsgi-httpd or mod-wsgi-standalone. Or do I have to revert to a manual config? Do I need to set CFLAGS or LDFLAGS, etc to force the issue? |
Yes, I can update - I realise it's a very old python. I was trying to replicate as near as possible my Mac intel dev environment first, but I'll try upgrading. Everything else works - mod_wsgi is my only remaining module to fix. (I use python 3.11 everywhere else, so I'll try that.) Sorry - Anaconda is our default dev python. I'll not be switching unless there's a major showstopper in the near future. I'll switch to using nginx if I have to! Many thanks for the speedy reponses! |
When using mod_wsgi-httpd or mod-wsgi-standalone it it is relying on building from Apache httpd source code, which as already mentioned will fail on macOS due to APR not being updated by the ASF. Although that said, it seems there was a release of APR back at April 16, 2023. It has been so long since I have done anything with mod_wsgi and checked whether they had fixed it is possible they may have as mod_wsgi-httpd is still using api-1.7.0, where as latest is now 1.7.4. Let me see if I can get it working with the later version. |
Thanks again for your engagement with this. mod_wsgi has been the solid backbone of our webserver code and I'll be gutted if I need to move my dev platform to a remote Ubuntu server without at least making an effort to resolve the ongoing issues. Not sure what time zone you're in, but I need to go offline for about 6 hours now! (I'm on UK time.) |
Am in Australia, so morning, but also got a lot of other work have to do. :-( Isn't a straight forward change to mod_wsgi-httpd due to demise of setuptools. So have to update setup.py file to whatever supposed to use now. Will see if can still sort something out. |
Okay, from Python 3.12 you have to install setuptools yourself. |
Seems later versions do work and can get mod_wsgi-httpd working again on macOS. Only took them a couple of years to fix APR. 🤷♂️ |
My internet connection had a lot of unexpected problems today due to a botched service transfer, so haven't managed to update mod_wsgi-standalone package yet as need to also roll some other mod_wsgi changes in as well. What I have been able to do though is update mod_wsgi-httpd, so try the following:
Keep running until it says none of the packages are installed. Then (preferably using a virtual environment), run:
Then run:
When installing mod_wsgi package it should detect that mod_wsgi-httpd was installed and use it. This is the long handed way that works instead of installing mod_wsgi-standalone package. |
Still persisting with my ancient python 3.8 install the
Hang on while I upgrade my whole environment to python 3.11, which I should have done in the first place. (Installation of mod_wsgi seemed to work, though I haven't tested it yet.) I have some reliance on setuptools for my own package, so I'll delay upgrading to 3.12 until I've got that fixed! |
Need to just search around to try and find a solution.
What version of setuptools are you using? Is it the latest version or an older version? |
Can you pin setuptools to be <71. |
Amazing. Pinning setuptools to 70 works fine! Many thanks for your help!! My python 3.8 environment is now functional. And also - many apologies for wasting your time. It turns out that upgrading to python 3.11, mod_wsgi (no standalone or httpd required) and Anaconda work together out of the box. No code signing, etc. All a good exercise for me, but not sure it's been useful for you. |
Not a waste of time as I have been sitting on needing to make some mod_wsgi changes for a while. Wasn't the best day for me to decide to do something about it with some big internet access issues and also needing to finish a release of a different project at same time but has worked out okay so far. :-) |
Hi Graham
I fear this is a very frequently asked question and with some repetition of #824. I have to switch to the M3 Arm-64 platform (Sonoma) and I cannot get mod_wsgi installed and running. The install looks like it worked but I get the dreaded message below. If this is in an FAQ, please feel free to direct me towards it!
I've tried signing the code (which complains that it's already signed - hence removed the existing signature and added my own), but specifying the certificate after the
LoadModule
statement in the generatedhttpd.conf
achieves nothing. It still complains that the module is unsigned.So, then I uninstalled it and tried to installed mod_wsgi-httpd or mod_wsgi-standalone. Now I get the same compilation errors. If only I could see where the code lives, I could probably fix the cast error for
pid_t
, etc.So I'm stuck from here. Is mod_wsgi simply now not compatible with Mac / Arm-64? Do I need to move my development platform off Sonoma?
The text was updated successfully, but these errors were encountered: