如何访问Apache虚拟主机与移动设备

如何访问Apache虚拟主机与移动设备

本文介绍了如何访问Apache虚拟主机与移动设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与主机名服务器1和服务器2设置Apache虚拟主机后,我将如何访问它们与我的iPhone(或任何移动设备),因为没有办法修改/ etc / hosts文件中的iOS或Android文件

我的理解是,你必须按名称(假设你只有你的物理服务器上1个IP地址)来引用虚拟主机,但没有办法对这些虚拟主机名到单个IP地址映射我的物理服务器上。

我正在使用甲基苯丙胺和我的Vonage公司的路由器/苹果AirPort不支持DNS我的笔记本电脑我的服务器。我是否需要安装一个本地DNS服务器?有没有简单的方法来运行我的笔记本电脑?谢谢你。


解决方案

您不能,如果你没有一个本地DNS。
作为一种解决方法,你可以设置你的第一个虚拟主机侦听的端口80和81(你想要或8080或任何端口),第二个上用的

After setting up Apache virtual hosts with hostnames "server1" and "server2", how would I access them with my iPhone (or any mobile device) since there's no way modify the /etc/hosts file in iOS or Android?

My understanding is that you have to reference the virtual hosts by name (assuming you only have 1 IP address on your physical server), but there's no way to map those virtual hostnames to the single IP address on my physical server.

I'm running my server on my laptop using MAMP and my Vonage router/Apple Airport don't support DNS. Do I need to setup a local DNS server? Is there any easy way to run that on my laptop? Thanks.

解决方案

You can't if you don't have a local DNS.As a workaround, you could setup your first VirtualHost to listen on the 80 port and the second one on the 81 (or 8080 or whichever ports you want) and access the server by using http://your.server.ip.addr:port.

这篇关于如何访问Apache虚拟主机与移动设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 18:56