【发布时间】:2016-04-27 18:15:18
【问题描述】:
我有一台电脑和一台 S3 在同一个 wifi 网络上,这台电脑有 apache 与 VirtualHost 一起为http://example.local 运行,还有一些其他的。这一切都可以在计算机上正常工作。电脑IP为10.0.0.2
手机已root,我将10.0.0.2 example.local www.example.local 附加到/system/etc/hosts 后,即使ping 正常,它也找不到域。我对此尝试了一些 SO 解决方案,但没有解决它,所以我删除了默认的 hosts 文件并将顶行保留为我的 10.0.0.2 定义。这现在在浏览器中连接到我的机器,但它只加载 localhost vhost 配置,而不是 example.local 配置。
httpd-vhosts.conf在电脑上
<VirtualHost localhost:80>
ServerAdmin tom.corby@tastecard.co.uk
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>
<VirtualHost www.example.local:80>
ServerAdmin tom.corby@tastecard.co.uk
DocumentRoot "C:/xampp/htdocs/www.example.co.uk/branches/release/3.4/www/"
ServerName www.example.local
ServerAlias example.local
ErrorLog "logs/www.example.local.log"
CustomLog "logs/www.example.local.log" common
<Directory "C:/xampp/htdocs/www.example.co.uk/branches/release/3.4/www/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
就像我说的那样,这可以在计算机上正常加载,我可以为我的 xampp/htdocs 目录加载 localhost,或者为更深的项目目录加载 example.local。我在android上得到的只是localhost目录
【问题讨论】:
标签: android apache virtualhost vhosts hosts