小编nap*_*lva的帖子

ebextensions 修改 httpd.conf

我想修改 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

apache amazon-ec2 httpd.conf amazon-web-services amazon-elastic-beanstalk

5
推荐指数
0
解决办法
1503
查看次数

Ruby:将字符串转换为浮点型

我有3个字符串变量需要添加。a =“ 5.21”,b =“ 5.22”,c =“ 5.23”。当我尝试添加时,我得到一个字符串,我需要数字值

我尝试了以下

a = a.to_f => 5.2
b = b.to_f => 5.2
c = c.to_f => 5.2
sum = a + b + c => 15.6
Run Code Online (Sandbox Code Playgroud)

我如何获得输出15.66。请帮忙

ruby

3
推荐指数
1
解决办法
4359
查看次数