Apache install is proving very problematic on latest MacBook Pro. I use Tomcat, which communicates with Apache using a very well-known module called jk_module (file name mod_jk.so)
Until Monterey, by using csrutil you could turn off SIP and simply copy mod_jk into the same folder as all the other modules, but SIP no longer allows you to do this. Now your only choice is to place it in a writeable folder. So it now sits at /usr/local/libexec/apache2/mod_jk.so all by itself, and in httpd.conf I tell LoadModule where to find it.
Problem (NOT solved): Apache won't start. And there is no log of any kind to give you a clue as to what is happening. There is nothing in system.log, and apache2/error.log hasn't even been created! After a day being mystified by this, I rediscovered apachectl -t, which I had forgotten about, which checks httpd.conf for you. And there at last I was told that I must code sign mod_jk.so, even though it is a piece of software that everybody knows and I didn't create.
Should be a piece of cake code signing a file right? Unfortunately not. After two days of trying all I ever manage to get is: "internal error in Code Signing subsystem".
In my travels into every corner of Google I found a couple of very detailed pages showing how to create your own Certificate Authority and then a Code Signing Certificate. Here is one of those links: https://www.simplified.guide/macos/apache-php-homebrew-codesign. Again all I ever got were error messages.
I then thought, well I'm an Apple paid-up developer, surely I should be using the Developer certificate which I use to sign my apps instead of creating an authority and a certificate ad hoc.
So I ran the following command to sign my file: codesign -d --verbose -s "Apple Development: A. Malcolm Warren (FV8Y5HRUQ8)" --force --keychain ~/Library/Keychains/login.keychain-db /usr/local/libexec/apache2/mod_jk.so
The answer is always: "internal error in Code Signing subsystem"
I have installed two intermediate "Apple Worldwide Developer Relations Certification Authority" certificates in my keychain - one of which expires in 2023, and the other in 2030, which I read about somewhere here in developer.apple.com.
Where do I go from here? How can I get this file code signed?
Placing the module in the Documents folder in my home folder for signing has solved this problem! And apachectl is happy if I run the config test (after placing the signed module back in its place).
Apache still doesn't start, but that's another problem, this one has been solved. Thank you so much for your help