【问题标题】:'httpd-vhost.conf' breaks Wamp?'httpd-vhost.conf' 打破了 Wamp?
【发布时间】:2026-01-17 01:45:02
【问题描述】:

这是我的第一篇文章...

我正在尝试使用 Wamp 从我的笔记本电脑托管一个开发网站;我的目标是安装 Wordpress 并让用户从那里登录...

  • 我已成功安装 Wamp 2.2。
  • 我已将27.0.0.1 localhost 包含在我的“主机”文件中。
  • 我已经从Include conf/extra/httpd-vhosts.conf 前面删除了#

localhost 完美运行,直到我编辑我的“httpd-vhost.conf”文件以包含以下内容...

<VirtualHost *:80>
    SeverAdmin webmaster@localhost
    ServerName localhost
    DocumentRoot C:/Program Files/WampServer2/www
    ErrorLog "C:/Program Files/WampServer2/www/logs/error.log"
    CustomLog "C:/Program Files/WampServer2/www/logs/access.log" common
</VirtualHost>

一旦我重新启动 Wamp,图标就会保持橙色。如果我尝试将 Wamp 置于联机状态,则会出现一个标题为“Aestan Tray Menu”的警报,指出“无法执行菜单项(内部错误)。[异常] 无法执行服务操作:服务尚未启动”。

  • 端口 80 测试为“未实际使用”。

当我运行“httpd.exe”时,会打开一个命令窗口,然后在我阅读之前立即关闭。我已经尝试了各种格式 &lt;VirtualHost *:80&gt; 无济于事,但是一旦我注释掉我的更改,我就能够成功重新启动 Wamp 并访问 localhost

我无法在任何地方找到有关此问题的帖子! 谢谢!

【问题讨论】:

  • 去看看error.log的配置路径,看看那里是否有任何有用的错误信息。我对 WAMP 如何通过其托盘图标报告错误一无所知,但对如何解释 Apache 错误日志了解很多。
  • 日志文件夹为空@MichaelBerkowski。这意味着什么?
  • 在主 httpd.conf 中查看是否已配置任何其他日志位置。如果它之前正确启动,那么它肯定会在某个地方至少有一个空的日志文件。
  • 我找到了“apache_error.log”...Child 10084: Child process is runningChild 10084: Acquired the start mutex.Child 10084: Starting 64 worker threads.Child 10084: Starting thread to listen on port 80.Child 10084: Starting thread to listen on port 80.Parent: Received shutdown signal -- Shutting down the server.Parent: Received shutdown signal -- Shutting down the server.Child 10084: Exit event signaled. Child process is ending.Child 10084: Released the start mutex@98765438@7@7 Parent: Child process exited successfully.
  • 里面有什么有用的信息吗?

标签: apache wamp virtualhost


【解决方案1】:

我不确定这是否如此复杂。我知道原来的帖子已经很老了,但仅适用于今天早上遇到类似问题的人。

要查看错误,请在命令提示符下运行 httpd.exe。只需打开命令提示符,然后将cd 放入包含httpd.exe 的文件夹中,然后键入httpd.exe(即不要只是在文件夹中双击它)。

结果应该告诉你错误在哪里。就我而言,这是 vhosts 文件中的语法错误。

【讨论】:

  • 感谢这有助于找到我的问题!
【解决方案2】:

我怀疑您的问题是未引用的 DocumentRoot,其中有一个空格。试试:

<VirtualHost *:80>
    SeverAdmin webmaster@localhost
    ServerName localhost
    DocumentRoot "C:/Program Files/WampServer2/www" # <- quotes added around this line
    ErrorLog "C:/Program Files/WampServer2/www/logs/error.log"
    CustomLog "C:/Program Files/WampServer2/www/logs/access.log" common
</VirtualHost>

【讨论】:

  • 这似乎没有帮助任何@Sarah Kemp。而且我的错误日志不包含尝试中的任何新条目...呃,这变得越来越令人沮丧。