首页 > 解决方案 > 使用域名而不是本地网络中的本地 IP 地址时,无法访问 XAMPP 托管的本地 HTML 网站

问题描述

我在局域网中使用 XAMPP 托管了一个 HTML 网页;http://IP address:port使用自定义域名时,我可以从同一本地网络中的其他计算机访问该网页,但无法访问该网页。

我的主机文件看起来像这样。

    192.168.1.24:90    cohab.com

我的 httpd-vhosts.config 如下所示。

    <VirtualHost 192.168.1.24:90>
    ServerAdmin webmaster@www.cohab.com
    ServerName www.cohab.com
    ServerAlias cohab.com
    DocumentRoot "C:/xampp/htdocs/cohab"
    </VirtualHost>

我的 HTML 文件存在于C:/xampp/htdocs/cohab directory. 我哪里错了?

标签: htmlapachexampphttpd.conf

解决方案


推荐阅读