Is it possible to use AWS Beanstalk's .ebextensions config to install mod_pagespeed Apache module?

前端 未结 4 530
执念已碎
执念已碎 2020-12-29 12:43

I\'m using AWS Beanstalk for my Django/Python application, and I would like to use Google\'s mod_pagespeed module. Is it possible to install and run mod_pagespeed using the

4条回答
  •  [愿得一人]
    2020-12-29 13:46

    You can install packages by URL. So you don't have to download and distribute the RPM. Something like this works:

    packages:
        rpm:
            pagespeed: https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
    files:
        "/etc/httpd/conf.d/zzzz-pagespeed-options.conf":
            mode: "00644"
            owner: root
            group: root
            encoding: plain
            content: |
                # put your pagespeed configuration here
    

    Note that I titled the file zzzz-pagespeed-options.conf so that the httpd server will load it last.

    Another advantage of this is you really don't need include any commands whatsoever or worry about copying files over and maintaining the files in your .ebextensions folder. You just update the files entry in the .config file.

提交回复
热议问题