问题
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