/etc/apache2/httpd.conf 丢失了?

/etc/apache2/httpd.conf 丢失了?

今天我发现我的 VPS 提供商物理重启了托管我 VPS 的机器。由于此错误,我无法再次启动 Apache:

apache2: Syntax error on line 214 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/httpd.conf: No such file or directory
Action 'start' failed.

唉,执行 ls /etc/apache2/httpd.conf 确实没有显示丢失的文件。

我不知道哪里出了问题。我根本没碰过这个文件。在进行物理操作之前,Apache 一直运行良好。

我该如何修复这个问题?我只需在 /etc/apache2 中执行“touch httpd.conf”,但显然这个文件包含一些重要内容,不应留空。

答案1

呼!更改我的谷歌查询后,我居然找到了这个 StackOverflow 问题询问有关空的 httpd.conf 文件的问题。阅读答案后,我确信我可以触摸该文件。

现在我有了这个文件(空的 - 就像它应该的那样)并且我的网站重新启动并运行。

我仍然不知道是什么原因造成的,但我很高兴我已经解决了它。

相关内容