Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.33k stars 9.72k forks source link

Cannot load mod_ssl.so into server - Reason: image not found #7418

Closed justinhartman closed 4 years ago

justinhartman commented 4 years ago

Debugging

brew gist-logs httpd can be found clicking here

What you were trying to do (and why)

I have been running httpd on my macOS for over a year now without issue. Today, for whatever reason, httpd won't run.

What happened (include command output)

I went to https://localhost and there was a dead page. ps aux | grep httpd returned nothing so it was not running.

I ran the following:

$ brew services start httpd
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)

Then:

$ brew services list
Name       Status  User   Plist
httpd      started justin /Users/justin/Library/LaunchAgents/homebrew.mxcl.httpd.plist

Important to note the Status column shows started but this is in orange and not green like the other services.

Running ps aux | grep httpd again still returned nothing.

When I try run httpd manually from the command line I finally get the error:

$ /usr/local/opt/httpd/bin/httpd -D FOREGROUND
httpd: Syntax error on line 146 of /usr/local/etc/httpd/httpd.conf: 
Cannot load lib/httpd/modules/mod_ssl.so into server: 
dlopen(/usr/local/opt/httpd/lib/httpd/modules/mod_ssl.so, 10): 
Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib\n  
Referenced from: /usr/local/opt/httpd/lib/httpd/modules/mod_ssl.so\n  
Reason: image not found

Checking the specific line number:

$ sed -n 145,147p /usr/local/etc/httpd/httpd.conf
#LoadModule slotmem_plain_module lib/httpd/modules/mod_slotmem_plain.so
LoadModule ssl_module lib/httpd/modules/mod_ssl.so
#LoadModule dialup_module lib/httpd/modules/mod_dialup.so

I also checked to see if the module was there:

$ ls -l /usr/local/opt/httpd/lib/httpd/modules/mod_ssl.so
-r--r--r--  1 justin  staff  211632 31 May  2019 /usr/local/opt/httpd/lib/httpd/modules/mod_ssl.so

But then the library is not:

$ ls -l /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
ls: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib: No such file or directory

Checking what is there shows me that libssl.1.1.dylib is there instead.

$ ls -lh /usr/local/opt/openssl/lib/
total 14496
drwxr-xr-x  4 justin  staff   128B 21 Apr 14:22 engines-1.1
-r--r--r--  1 justin  staff   2.2M 22 Apr 01:51 libcrypto.1.1.dylib
-r--r--r--  1 justin  staff   3.8M 21 Apr 14:22 libcrypto.a
lrwxr-xr-x  1 justin  staff    19B 21 Apr 14:22 libcrypto.dylib -> libcrypto.1.1.dylib
-r--r--r--  1 justin  staff   479K 22 Apr 01:51 libssl.1.1.dylib
-r--r--r--  1 justin  staff   707K 21 Apr 14:22 libssl.a
lrwxr-xr-x  1 justin  staff    16B 21 Apr 14:22 libssl.dylib -> libssl.1.1.dylib
drwxr-xr-x  5 justin  staff   160B 22 Apr 01:51 pkgconfig

Output of brew config and brew doctor commands

See the output from running '$ brew update':
$ brew update
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
quill
==> Updated Formulae
openssl@1.1 ✔         azure-cli             contentful-cli        goreleaser            juju                  prometheus            timewarrior           vala
allure                conan                 gitlab-runner         jenkins               llvm@8                texlab                trafficserver         wrangler
==> Updated Casks
4k-video-downloader                 focuswriter                         google-earth-pro                    melodics                            sound-control
abstract                            fontbase                            gpower                              parallels                           stand
airdisplay                          fsnotes                             harvest                             postbox                             terminus
alt-tab                             futuniuniu                          hubstaff                            postico                             trilium-notes
appcode                             ganache                             iglance                             praat                               ultimaker-cura
chromium                            gearboy                             insync                              qownnotes                           universal-media-server
clover-configurator                 gearsystem                          kapow                               scaleft                             zappy
cryptomator                         geogebra                            krisp                               screen                              zeplin
dcv-viewer                          glip                                latexit                             second-life-viewer
drama                               glyphs                              macpilot                            segger-embedded-studio-for-arm
fantastical                         google-chrome                       mailbutler                          session
==> Deleted Casks
safaricookiecutter                                                                        safarisort
  
See the output from running '$ brew doctor':
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers  
with debugging if you file an issue. If everything you use Homebrew for is  
working fine: please don't worry or file an issue; just ignore this. Thanks!  

Warning: "config" scripts exist outside your system or Homebrew directories.  
`./configure` scripts often look for *-config scripts to determine if  
software packages are installed, and which additional flags to use when  
compiling and linking.

Having additional scripts in your path can confuse software installed via  
Homebrew if the config script overrides a system or Homebrew-provided  
script of the same name. We found the following "config" scripts:

/Users/justin/Library/Python/3.7/bin/powerline-config
  
justinhartman commented 4 years ago

It would seem, brew reinstall httpd fixes this problem. I am not sure if this is the intended fix for this problem though?

MikeMcQuaid commented 4 years ago
  • [ ] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue? Not applicable

brew config output is always applicable. Please provide it in future issues.