mod_cloudflare 在弹性豆茎上

mod_cloudflare on elastic beanstalk

我尝试通过提供这样的配置文件来安装它:

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

我还没有找到解决方案...

已修复:

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