如何测试文件是否存在带有标签 <If ...>在 Apache 2.4 上? [英] How to test if file exists with the tag <If ...> on Apache 2.4?

查看:34
本文介绍了如何测试文件是否存在带有标签 <If ...>在 Apache 2.4 上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试 Apache 2.4 的 httpd.conf 中是否存在文件.

I would like to test the existence of a file in my httpd.conf of Apache 2.4.

我使用这样的标签:

...要执行的代码 ...</如果>

但是我的代码不好,apache的服务不想启动.我在许多网站上阅读了大量教程或文档,但从未找到答案:(

but my code is not good, apache's service doesn't want to start. I have read a lot of tutorials or docs on many sites but never found the answer :(

请帮帮我...

推荐答案

您应该阅读 Apache 错误日志,因为它可能会提供有关如何解释它的一些提示.

You should read Apache error log as it might provide some hint on how it is interpreted.

无论如何,正确的语法是:

Anyway, the right syntax is: <If "-f %{DOCUMENT_ROOT} . '/maintenance.enable'">

这篇关于如何测试文件是否存在带有标签 &lt;If ...&gt;在 Apache 2.4 上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆