【问题标题】:xtreme slow response from apache localhost [closed]来自apache localhost的xtreme响应缓慢[关闭]
【发布时间】:2026-01-23 04:00:01
【问题描述】:

我在 localhost 和 PHP 5.5.8 上遇到 apache2 问题。在 Macosx 上 一切都是用 Homebrew 安装的。

延迟的原因可能是什么? 当我想停止服务器时,它有时会响应

httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.43.114 for ServerName

我就是这样设置的

<VirtualHost *:80>
    ServerAdmin webmaster@test.dev  
    DocumentRoot "/Users/redres/Webdev/testsetup/public"
    ServerName test.dev
    ServerAlias test.dev
    <Directory "/Users/redres/Webdev/testsetup/public">
       Options FollowSymLinks Indexes MultiViews
       Options All
       AllowOverride All
       Order allow,deny
       Allow from All
       Header Set Cache-Control no-cache
    </Directory>
</VirtualHost>

【问题讨论】:

  • 我知道在 macosx 下为 vhost 使用 .local 地址时会有 5 秒的延迟,因为某些 bonjour 特定的查找。鉴于您没有使用 .local,那么您需要提供有关您的问题的更多信息以获得帮助。
  • 你需要什么,我有一个自制软件的基本安装,所以这就是我所做的全部设置,加上主机文件。
  • @Dagon,谢谢。我也遇到了那个链接,我正在阅读它。另外,也许这里有人在迁移到 apache2 时遇到了同样的问题。

标签: php macos apache localhost


【解决方案1】:

尝试启用缓存:

Header Set Cache-Control public

也读一读: https://*.com/a/4480318/3199478

深入阅读: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

【讨论】:

  • 我会看看那些链接。
  • 谢谢,缓存帮助解决了这个问题。