【发布时间】:2022-01-11 06:16:31
【问题描述】:
我尝试创建一个通用的 httpd.conf,使用 if 语句来决定使用哪个端口。
# In HOME the path of the home directory of the apache user is set
PassEnv HOME
Define HTTPServerPath "${HOME}/HTTPServer"
<If "%{HTTPServerPath} -strcmatch '*something*'">
Define ListenPort 1080
</If>
<Else>
Define ListenPort 1180
</Else>
这不起作用,因为定义行中的变量似乎不可用。如何实现这样的通用配置文件?
【问题讨论】:
-
我在某个地方找到了
<If "'${HTTPServerPath}' -strcmatch '*something*'">但这也行不通。结果总是假的。
标签: apache httpd.conf