从本地虚拟机访问虚拟主机
我有一个名为 project 的虚拟主机,因此在我的本地主机中我访问 http://project ,一切正常,网络服务器位于 Apache 2.2 中乌班图11.04。然后我需要在 Safari 和 IE 上测试这个项目,我在同一台计算机上有一个装有 Windows XP 的虚拟机(使用 VirtualBox)。
如何从虚拟机访问我的虚拟主机?我已经在虚拟机中的 IE 中尝试过 http://project 但没有成功。我可以尝试 http://192.168.1.20/project (我的本地IP)它可以工作,但我真的需要访问使用虚拟主机名(http://project),因为很多代码和重写规则仅在我使用 http://project 时才起作用
谢谢
I have a virtualhost called project so in my localhost I access http://project and everything is ok, the webserver is in Apache 2.2 in Ubuntu 11.04. Then I need to test this project on Safari and IE, I have a Virtual Machine with Windows XP in the same computer (using VirtualBox).
How can I access to my virtualhost from the virtual machine? I've tried http://project from IE in the virtual machine and it didn't work. I could try http://192.168.1.20/project (my local ip) it work but I really need to access with the virtualhost name (http://project) because a lot of code and rewrite rules only work when I use http://project
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为管理员,在 XP 虚拟机上编辑
C:\Windows\System32\drivers\etc\hosts
并添加以下行;之后,您应该能够通过主机名访问它。
As an administrator, edit
C:\Windows\System32\drivers\etc\hosts
on your XP virtual machine and add the line;After that, you should be able to access it by host name.