Apache start problem Under Sonoma (Mac M1) I get httpd error 256

Hello,

I want to Install a SSL webserver under Sonoma at my Mac. I install Homebrew and httpd at my Mac. I hate the console.

I change the listen to 80 and the document path.


at the console:

uwerasche@raschesserver ~ % brew services start httpd

==> Successfully started httpd (label: homebrew.mxcl.httpd)

uwerasche@raschesserver ~ % brew services list

Name Status User File

httpd started uwerasche ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist



No problem. In the httpd.conf I load only the module:

#Uwe:

LoadModule cache_socache_module lib/httpd/modules/mod_cache_socache.so


I get:

uwerasche@raschesserver ~ % brew services list

Name Status User File

httpd error 256 uwerasche ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist


In the next step:

uwerasche@raschesserver ~ % codesign --sign ${myName} --force --keychain ~/Library/Keychains/login.keychain-db /opt/homebrew/Cellar/httpd/2.4.58/lib/httpd/modules/mod_cache_socache.so

/opt/homebrew/Cellar/httpd/2.4.58/lib/httpd/modules/mod_cache_socache.so: replacing existing signature


uwerasche@raschesserver ~ % codesign -dv --verbose=4 "/opt/homebrew/Cellar/httpd/2.4.58/lib/httpd/modules/mod_cache_socache.so"

Executable=/opt/homebrew/Cellar/httpd/2.4.58/lib/httpd/modules/mod_cache_socache.so

Identifier=mod_cache_socache

Format=Mach-O thin (arm64)

CodeDirectory v=20400 size=757 flags=0x0(none) hashes=18+2 location=embedded

VersionPlatform=1

VersionMin=917504

VersionSDK=917504

Hash type=sha256 size=32

CandidateCDHash sha256=f0842d7ebafb5d389b207ce279659c219b107c22

CandidateCDHashFull sha256=f0842d7ebafb5d389b207ce279659c219b107c226d45dd47cf997ad818a3b3bb

Hash choices=sha256

CMSDigest=f0842d7ebafb5d389b207ce279659c219b107c226d45dd47cf997ad818a3b3bb

CMSDigestType=2

Executable Segment base=0

Executable Segment limit=32768

Executable Segment flags=0x0

Page size=4096

CDHash=f0842d7ebafb5d389b207ce279659c219b107c22

Signature size=8980

Authority=Developer ID Application: Rasche-Software (KH23P8U5C6)

Authority=Developer ID Certification Authority

Authority=Apple Root CA

Timestamp=19. Nov 2023 at 10:18:15

Info.plist=not bound

TeamIdentifier=KH23P8U5C6

Sealed Resources=none

Internal requirements count=1 size=180


Now I get again the error:


uwerasche@raschesserver ~ % brew services start httpd

==> Successfully started httpd (label: homebrew.mxcl.httpd)

uwerasche@raschesserver ~ % brew services list

Name Status User File

httpd error 256 uwerasche ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist


What can I do ?


Best regards


Uwe

MacBook Pro 15″, OS X 10.11

Posted on Nov 19, 2023 2:33 AM

Reply
10 replies

Nov 19, 2023 5:01 AM in response to Uwe Rasche

Apache comes built-in to the operating system. There is nothing else you need to install. I've posted some instructions on how to configure it here: Setting up a local web server on macOS 14… - Apple Community


You are actually using Terminal, not Console. Console is a logging tool and it's much worse.


Otherwise, this is a typical Homebrew problem. The only thing unusual about your post is that you straight up mentioned Homebrew right away. Usually I have to pry that information out of people. Any time someone shows up here with some crazy problem no one has ever seen before in Terminal, Homebrew is the cause.


Unfortunately, you will find Homebrew very difficult to remove. It makes significant changes to your command line environment. You will need advanced Terminal skills to correct the damage.


I usually just recommend that people erase the hard drive and reinstall the operating system. When you restore from backup, make sure to NOT restore apps, software, system settings, or "other files". With Homebrew, I'm not even sure you can restore your user accounts and user files. Some of your command line configuration files are stored in the home directory. But once you fix the larger problems, you can at least create a new user account. You can copy the command line config files from that new user account back to your current account and finally undo whatever Homebrew has done.


Good luck!

Nov 19, 2023 11:54 AM in response to UweRasche

UweRasche wrote:

I have 2 other Mac. At this Mac Homebrew was never install. There also the internal apache server from OSX.

Apache is not like typical apps. It includes a number of configuration files in /etc/apache2. If these have been modified in any way, then Apache may not run.

I get the following error:

Raschesserver:~ uwerasche$ sudo apachectl configtest

[Sun Nov 19 18:13:01.786866 2023] [so:error] [pid 3930] AH06665: No code signing authority for module at /usr/libexec/apache2/mod_cache_socache.so specified in LoadModule directive.

httpd: Syntax error on line 98 of /private/etc/apache2/httpd.conf: Code signing absent - not loading module at: /usr/libexec/apache2/mod_cache_socache.so

It is no so easy to try the codesign tool. Do you understand me.

You don't need to use the codesign tool at all. You need to correct your Apache configuration. The mod_cache_socache module is not enabled by default. Furthermore, it is not on line 98. You, or some other entity, had made changes to your Apache config file and now it will not work. What those chances are, I can't say. All I can say is that you either have to learn codesign, learn Apache configurations, or rebuild your system using default settings.


My instructions for running Apache always assume default settings. There are 557 lines in /etc/apache2/httpd.conf. Your version might have more. Any line could be changed. That's literally an infinite number of possibilities. You either learn to swim with the defaults and progress slowly, or dive in head-first into the deep end and hope it all works out.


PS: While checking the default settings of mod_cache_socache, I had to setup Apache again in a new Sonoma VM. I discovered a small error in my instructions and corrected it. Setting up Apache in Sonoma should take about 45 seconds.

Nov 19, 2023 5:45 AM in response to etresoft

.

I have this problem which the internal Mac apache server too. It is not the problem from Homebrew.


I get a "permission" error. I try it now with Homebrew, because the files are not in the protection folders.


I don´t know, how I can tell macOs to start it. It has no ".app" attention. I think, this is the problem.


Thanks


PS: Homebrew put all part in one folder. Delete is easy. So the description . I have only extent the $path folder. I do it manual today


Nov 19, 2023 7:38 AM in response to Uwe Rasche

Uwe Rasche wrote:

I have this problem which the internal Mac apache server too. It is not the problem from Homebrew.

Even when someone never mentions the word, I can tell, just by their description, when it is caused by Homebrew. In your case, the word "homebrew" was in practically every line of your post.


Once you install Homebrew, it corrupts the entire system. Even the built-in Apache isn't going to work anymore.

I get a "permission" error. I try it now with Homebrew, because the files are not in the protection folders.

I don´t know, how I can tell macOs to start it. It has no ".app" attention. I think, this is the problem.

The problem is Homebrew.

PS: Homebrew put all part in one folder. Delete is easy. So the description . I have only extent the $path folder. I do it manual today

If it's easy, then it should be easy to fix. Voila! Problem solved.

Nov 19, 2023 11:02 AM in response to etresoft

I have 2 other Mac. At this Mac Homebrew was never install. There also the internal apache server from OSX.

I get the following error:


Raschesserver:~ uwerasche$ sudo apachectl configtest


[Sun Nov 19 18:13:01.786866 2023] [so:error] [pid 3930] AH06665: No code signing authority for module at /usr/libexec/apache2/mod_cache_socache.so specified in LoadModule directive.


httpd: Syntax error on line 98 of /private/etc/apache2/httpd.conf: Code signing absent - not loading module at: /usr/libexec/apache2/mod_cache_socache.so


It is no so easy to try the codesign tool. Do you understand me.

Nov 19, 2023 12:11 PM in response to Barney-15E

Barney-15E wrote:

The default mod_cache_socache.so does not generate a code signing issue. Where did you get your version of that module?

It did for me when I first tried it. Then when I went to the Apache site to figure out just what it is supposed to do, the Apache site listed another module dependency that is required. When I enabled that one, then it worked. But I still don't know what that module is used for.


Apparently, it is a "Shared object cache (socache) based storage module for the HTTP caching filter." Woohoo! Party in the house tonight!

Apache start problem Under Sonoma (Mac M1) I get httpd error 256

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.