XAMPP 重定向到内部网络上的 XAMPP 目录
我在桌面上安装了 XAMPP。我为大约 5 个站点设置了虚拟主机,它们都可以在桌面上正常工作。
每当我尝试从笔记本电脑访问这些虚拟主机时,就会出现问题。我更改了笔记本电脑上的主机文件,以将笔记本电脑 dev.domain.com 请求重定向到桌面,但是,当我尝试从本地网络上的笔记本电脑访问这些站点时,我只收到 XAMPP 欢迎屏幕。似乎当尝试从笔记本电脑访问桌面上的虚拟主机时,虚拟主机文件被忽略,因为所有请求都被重定向到 xampp 目录。
我需要进行哪些调整才能确保从笔记本电脑访问桌面上的虚拟主机?
I installed XAMPP on my desktop. I set up vhosts for about 5 sites and they are all working properly from the desktop itself.
The problem arises whenever I try to access these vhosts from my laptop. I changed the hosts file on the laptop to redirect the laptop dev.domain.com requests to the desktop, however, when I try to access these sites from my laptop on the local network, I only receive the XAMPP welcome screen. It seems like when trying to access the vhosts on the desktop from the laptop the vhosts file is ignored as all requests are redirected to the xampp directory.
What might I need to adjust to ensure access to the vhosts on the desktop from the laptop?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了我的问题的答案。对于所有其他需要此答案的人,请参阅以下网站以获得全面的解释:
http://www.ozestretch.com/forum/viewtopic。 php?t=5&f=6
简而言之,有 3 个问题需要解决。
首先,您需要寻址联网计算机上的主机文件。例如,联网计算机上的主机文件将具有以下指向 xampp 计算机的 IP 地址的请求:
请记住,上面的 IP 地址是 xampp 服务器的 IP 地址。
其次,xampp 计算机的主机文件也必须在其主机文件中具有相同的地址才能使站点正常工作。起初这对我来说似乎是多余的,但它确实有效,所以我没有争论。因此,xampp 服务器上的主机文件也将具有:
最后,xampp 计算机上的 httpd-vhosts.conf 文件必须具有以下行:
希望这个答案可以帮助其他人。
I found the answer to my question. For all others that are in need of this answer, please refer to the following site for a comprehensive explanation:
http://www.ozestretch.com/forum/viewtopic.php?t=5&f=6
In brief, there are 3 items that need addressed.
First, you need to address the hosts file on on the networked machine. For example, the host file on networked machine would have the following pointing requests to the xampp machines's IP address:
Remember, the above IP address is that of the xampp server.
Second, the xampp machine's host file must also have this same address in its host file in order for the site to work. This seemed redundant to me at first, but it works so no argument from me. So, the hosts file on the xampp server will also have:
Lastly, the httpd-vhosts.conf file on the xampp machine must have the following line:
Hope this answer helps others out there.