弹性豆茎上的 mod_cloudflare

Posted

技术标签:

【中文标题】弹性豆茎上的 mod_cloudflare【英文标题】:mod_cloudflare on elastic beanstalk 【发布时间】:2015-04-02 20:09:07 【问题描述】:

我尝试通过提供如下配置文件来安装它:

packages:
  rpm:
    mod_cloudflare: https://www.cloudflare.com/static/misc/mod_cloudflare/centos/mod_cloudflare-el6-x86_64.latest.rpm

files:
  "/etc/httpd/conf.d/cloudflare.conf":
    mode: "000644"
    owner: root
    group: root
    content: |
      CloudFlareRemoteIPHeader X-Forwarded-For
      CloudFlareRemoteIPTrustedProxy 10.0.0.0/8

但它最终没有正确安装:

AH00526: Syntax error on line 2 of /etc/httpd/conf.d/cloudflare.conf:
Invalid command 'CloudFlareRemoteIPHeader', perhaps misspelled or defined by a module not included in the server configuration

我发现 cloudflare.so 上没有 load_module,所以在将加载模块手动添加到 cloudflare.conf 后,我得到了这个:

httpd: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.d/cloudflare.conf: Cannot load modules/mod_cloudflare.so into server: /etc/httpd/modules/mod_cloudflare.so: undefined symbol: ap_log_rerror

我还没有找到解决办法...

【问题讨论】:

【参考方案1】:

修复它:

packages:
  yum:
      glibc.i686: []
      libtool: []
      httpd24-devel: [] // <--!

commands:
  00-cloudflare: 
    command: wget https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c
    cwd: /tmp
  01-cloudflare: 
    command: apxs -a -i -c mod_cloudflare.c
    cwd: /tmp

files:
  "/etc/httpd/conf.d/cloudflare.conf":
    mode: "000644"
    owner: root
    group: root
    content: |
      CloudFlareRemoteIPHeader X-Forwarded-For
      CloudFlareRemoteIPTrustedProxy 10.0.0.0/8

【讨论】:

以上是关于弹性豆茎上的 mod_cloudflare的主要内容,如果未能解决你的问题,请参考以下文章

弹性豆茎上的 mod_cloudflare

云形成的弹性豆茎上的 SSL 证书

在弹性豆茎上运行 mongo 并连接到它 - 利弊?

如何在弹性豆茎上更新 python Flask 应用程序?

在弹性豆茎上运行 celery-worker

如何在弹性豆茎上强制 https?