apache - 无法访问此站点 - XAMPP 忽略自定义域虚拟主机
问题描述
环境
- XAMPP 7.2.4 安装在 Windows 10 上
- Apache 在端口 80 和 443 上运行
配置
C:\Windows\System32\drivers\etc\hosts
:
127.0.0.1 www.test.local test.local
C:\xampp\apache\conf\httpd.conf
:
DocumentRoot "D:/htdocs"
<Directory "D:/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
C:\xampp\apache\conf\extra\httpd-vhosts.conf
:
<VirtualHost *:80>
DocumentRoot D:/htdocs
ServerName localhost
<Directory "D:/htdocs">
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:/htdocs
ServerName test.local
<Directory "D:/htdocs">
Allow from all
</Directory>
</VirtualHost>
问题
当我启动 Apache 并且我访问localhost
是没问题的。当我尝试访问时出现问题test.local
:浏览器返回无法访问此站点消息。就像 XAMPP 忽略了定义在httpd-vhost.conf
文件中的自定义域虚拟主机一样。服务器关闭时显示相同的消息。
This site can’t be reached
The webpage at http://test.local/ might be temporarily down or it may have moved permanently to a new web address.
ERR_ADDRESS_INVALID
几天前,设置工作正常,我所做的唯一更改是新软件安装。我的意思是,Apache 配置文件没有变化。
解决方案
推荐阅读
- python - 如何在熊猫中创建计算的新列
- python - 如何在 selenium 上将多个文本连接在一起?
- php - 允许的用户角色的 WooCommerce 优惠券使用限制
- c# - 如何在 C# 中获取 JSON 中的最后一项
- vba - 从 Outlook 项目中提取最后更新的时间戳
- css - Bootstrap vue:表单组标签样式
- c++ - 使用 Dijkstra 算法跟踪两个节点之间的最短路径
- javascript - 使用 HTTP PUT 获取后 setState 挂钩未更新
- angular - DataGrid 不包含在 Angular 订阅范围内的“this”上下文中
- angular - 在 Angular 中路由到外部应用程序(例如 Wordpress)