You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过安卓设备访问本地基于名称的VirtualHost

问题:安卓设备无法访问笔记本上的基于名称的VirtualHost

我在笔记本上配置了若干基于名称的VirtualHost,例如:

www.example1.dev
www.example2.dev
...

我希望通过USB连接的安卓设备访问这些虚拟主机,且设备已与笔记本处于同一WiFi网络中,但每次尝试访问时都会出现address not found错误。此前查阅的相关问题仅涉及IP地址访问,无法解决我这种基于名称的VirtualHost场景问题。

补充说明1

Apache虚拟主机配置文件(/etc/apache2/sites-available/examplesite1.dev.conf)

<VirtualHost *:80>

    <Directory /var/www/examplesite1>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ServerName examplesite1.dev.com
    ServerAlias www.examplesite1.dev.com
    
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/examplesite1


    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

笔记本的/etc/hosts配置

127.0.0.1   examplesite1.dev.com
192.168.250.1   examplesite1.dev.com
192.168.1.51    examplesite1.dev.com

内容的提问来源于stack exchange,提问作者Sasha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 08:45:29