How to install modules for Apache 2.4 (OSX)?

浪子不回头ぞ 提交于 2019-12-25 00:38:23

问题


I installed apache with Homebrew. When I start the default installation I get this error:

httpd: Syntax error on line 85 of /usr/local/etc/httpd/httpd.conf: Cannot load lib/httpd/modules/mod_auth_basic.so into server: dlopen(/usr/local/var/www/lib/httpd/modules/mod_auth_basic.so, 10): image not found

I went through commenting unfound modules out but it seems like it's missing all of them, especially useful ones like mod_auth_basic. Looking at tutorials for installing apache with homebrew, I've noticed the paths it installed to on my computer are vastly different than what they are in the tutorial.

How do I install these modules (preferably with an all-in-one package as opposed to one at a time)?

Edit:

After looking at the error message for a second, I realized that the dlopen() is using my ServerRoot as the base for the modules. Instead of

dlopen(/usr/local/var/www/lib/httpd/modules/mod_auth_basic.so)

it should be

dlopen(/usr/libexec/apache2/mod_auth_basic.so

So how do I point the module loader to the correct directory?

Edit:

I solved the issue with modules not loading, but I would still love to know how to add modules.


回答1:


If your module dir is /usr/libexec/apache2, then you may need to disable SIP in order to be able to copy module file (*.so) there. The following discussion may help: https://apple.stackexchange.com/questions/193368/what-is-the-rootless-feature-in-el-capitan-really

Anyway, if you want more liberty with your httpd installation, you may want to download and build the source. It is quite simple and you can install it in any directory which is not protected (the suggested default is /usr/local/apache2 which is fine) so you don't need to go through the hassle of disabling SIP.



来源:https://stackoverflow.com/questions/50604319/how-to-install-modules-for-apache-2-4-osx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!