Enable mod_header in apache in Mac OS X for CORS

倖福魔咒の 提交于 2021-01-04 05:50:38

问题


I'm trying to set up my site to allow CORS for cross domain scripting, however this seems to require mod_header to be enabled in my .htaccess file. I don't have much experience dealing with apache.

I tried to google installing mod_header in apache on mac os but couldn't find any.

I tried this user@mymac:~$ httpd -l and here are the modules currently installed.

  core.c
  prefork.c
  http_core.c
  mod_so.c

Is anyone with knowledge able to tell me how to install mod_header in Mac OS?

Thanks


回答1:


I believe you're referring mod_headers. Normally it's already installed as shared module in apache.

Try this:

$ httpd -M |grep header

You should see:

Syntax OK
 headers_module (shared)

If not, go to /etc/apache2/httpd.conf, find line below and uncomment it

# LoadModule headers_module libexec/apache2/mod_headers.so


来源:https://stackoverflow.com/questions/17127523/enable-mod-header-in-apache-in-mac-os-x-for-cors

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