我在同一個wifi網絡上有一臺電腦和一個S3,計算機有Apache和虛擬主機運行http://example.local,以及其他一些。這一切都可以在電腦上正常工作。計算機IP是10.0.0.2訪問Android上的本地apache虛擬主機(同一網絡)
電話是根深蒂固的,我將10.0.0.2 example.local www.example.local
追加到/ system/etc/hosts,即使ping工作,它也找不到域。我嘗試了一些SO解決方案,但沒有解決它,所以我刪除了默認hosts
文件,並保留頂部行作爲我的10.0.0.2
定義。這現在連接到我的機器在瀏覽器中,但它只加載localhost
虛擬主機配置,而不是example.local
之一。
計算機
<VirtualHost localhost:80>
ServerAdmin [email protected]
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>
<VirtualHost www.example.local:80>
ServerAdmin [email protected]
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>
上httpd-vhosts.conf
就像我說的這個加載罰款的計算機上,我可以加載localhost
我的XAMPP/htdocs目錄,或example.local爲更深層次的項目目錄。所有我曾經得到Android是localhost
目錄