【发布时间】:2015-08-15 06:54:03
【问题描述】:
我使用 xamp 作为我的桌面测试服务器。我还有其他运行良好的应用程序。
此网址有效:http://localhost/PatchUpdate/ 我正在尝试让这个 url 工作:PatchUpdate.local
我的 httpd-vhost.conf 如下所示:
<VirtualHost *:80>
ServerName PatchUpdate.local
DocumentRoot "D:/app/xampp/htdocs/PatchUpdate"
ErrorLog "logs/PatchUpdate.log"
CustomLog "logs/PatchUpdate.log" common
</VirtualHost>
奇怪的是,我还有其他运行良好的主机。这是一个使用 jkmount 映射我的客户端和服务器端的方法
<VirtualHost *:80>
DocumentRoot "D:/app/xampp/htdocs/OutageReport"
ServerName OutageReport.local
JkMount /OutageReportSvc/* worker1
ErrorLog "logs/OutageReport.log"
CustomLog "logs/OutageReport.log" common
</VirtualHost>
检查 httpd -S 给了我这个:
port 80 namevhost PatchUpdate.local (D:/app/xampp/apache/conf/extra/httpd-vhosts.conf:105)
看起来它已正确设置并且 Apache 可以看到映射。但是当我尝试击球时 patchupdate.local
我收到“未找到服务器”错误,并且 URL 被替换为 http://www.patchupdate.local/
有谁知道为什么这个特定的虚拟主机在其他主机运行时不起作用?
谢谢
【问题讨论】:
-
ServerName 是 patchupdate.local,而不是 www.patchupdate.local
-
找到了。我还必须将 127.0.0.1 PatchUpdate.local 添加到我的 etc/host 文件中。