在Mac OS X中为CORS在Apache中启用mod_header [英] Enable mod_header in apache in Mac OS X for CORS

查看:59
本文介绍了在Mac OS X中为CORS在Apache中启用mod_header的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图设置我的站点以允许CORS进行跨域脚本编写,但是这似乎要求在我的.htaccess文件中启用 mod_header .我在处理Apache方面经验不足.

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.

我尝试在Mac OS上用Google搜索在Apache的Apache中安装mod_header ,但找不到任何内容.

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

我尝试了这个 user @ mymac:〜$ httpd -l <​​/code>,这是当前安装的模块.

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

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

有知识的人能告诉我如何在Mac OS中安装 mod_header 吗?

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

谢谢

推荐答案

我相信您指的是 mod_headers .通常,它已作为共享模块安装在apache中.

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

尝试一下:

$ httpd -M |grep header

您应该看到:

Syntax OK
 headers_module (shared)

如果没有,请转到/etc/apache2/httpd.conf ,找到下面的行并取消注释

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

# LoadModule headers_module libexec/apache2/mod_headers.so

这篇关于在Mac OS X中为CORS在Apache中启用mod_header的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆