ebextensions 修改 httpd.conf

nap*_*lva 5 apache amazon-ec2 httpd.conf amazon-web-services amazon-elastic-beanstalk

我想修改 httpd.conf 的仅 1 行,而不必通过 .ebextensions 用新文件替换整个文件

这是我想要实现的目标

我想从默认格式 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\ 更改 logFormat "" 组合

到 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" 组合以包括持续时间在访问日志中。

请指教。

我有2个文件

logFormat_sub.conf

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
Run Code Online (Sandbox Code Playgroud)

和文件 2 - 03httpd_logFormat.config

container_commands:
01_setup_apache:
    command: "cp .ebextensions/logFormat_sub.conf /etc/httpd/conf/httpd.conf"
Run Code Online (Sandbox Code Playgroud)

但我认为这仅用 logFormat_sub.conf 的内容替换了整个 http.conf