简体   繁体   English

wamp本地ip添加本地域名

[英]Wamp local ip add a local domain name


Ok, I have Wamp on my laptop up and running.好的,我的笔记本电脑上有 Wamp 并正在运行。 I also configured it to be visible on all the devices in my local network, so that I could connect to it on my Phone and other laptops.我还将它配置为在本地网络中的所有设备上都可见,以便我可以在我的手机和其他笔记本电脑上连接到它。

I have created a virtual host via wamp tools (Add a Virtual Host) named myexample.etc and it works from the laptop where I am running wamp (the server, let's say).我通过名为 myexample.etc 的 wamp 工具(添加虚拟主机)创建了一个虚拟主机,它可以在我运行 wamp 的笔记本电脑上工作(假设是服务器)。 But it doesn't work from other devices connected to the same network.但它不适用于连接到同一网络的其他设备。 It only works by typing the IP, not by typing the dns created.它只能通过输入 IP 来工作,而不是通过输入创建的 dns。

Is it possible to do something to access this dns (virtual host) created from other devices in the same network?是否可以做一些事情来访问从同一网络中的其他设备创建的这个 dns(虚拟主机)?

Thank you in advance!先感谢您!

I assume you do not actually have a DNS Server running.我假设您实际上没有运行 DNS 服务器。

So when you say DNS, you mean you change the HOSTS file on the PC running WAMPServer.因此,当您说 DNS 时,您的意思是您更改了运行 WAMPServer 的 PC 上的 HOSTS 文件。

This works by seeding the DNSCache on that PC at boot time, it does not and cannot have any effect on any other device in your local network.这是通过在启动时在该 PC 上播种 DNSCache 来实现的,它不会也不会对本地网络中的任何其他设备产生任何影响。 So there are basically 2 ways to access your website running on WAMPServer.所以基本上有两种方法可以访问在 WAMPServer 上运行的网站。

  1. You amend all the other PC's HOSTS file and add something like this, assuming the WAMPServer PC is on IP Address 192.168.1.10您修改所有其他 PC 的 HOSTS 文件并添加类似内容,假设 WAMPServer PC 位于 IP 地址 192.168.1.10

     192.168.1.10 myexample.etc

If you cannot access the HOSTS file on all the other devices such as phones and tablets that have not been jailbroken如果您在其他所有未越狱设备(如手机和平板电脑)上都无法访问 HOSTS 文件

  1. Access the site by the IP Address of the PC running WAMPServer, I wrote up a way of doing that on another question, so here is the link通过运行 WAMPServer 的 PC 的 IP 地址访问该站点,我在另一个问题上写了一种方法,所以这里是链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM