从Windows主机访问VirtualBox Web服务器来宾网站

时间:2020-01-29 16:37:11

标签: windows web server virtualbox virtualhost

我有一个Virtual Box Ubuntu来宾,它具有Apache和一些PHP网站。 我的主机操作系统是Windows 7。 我可以从主机访问访客(我已经配置了网桥连接) 例如,在Windows中,我将此URL放在浏览器中:http://192.168.56.103/ 我可以看到Apache起始主页。 在Ubuntu上,我有一些网站,并且可以正常访问,例如: http://localhost/gastos/index.phphttp://localhost/blog/index.php 等等...

我想从Windows主机浏览器访问此网站,我试图在Windows浏览器中选择以下uri: http://192.168.56.103/gastos/index.php http://192.168.56.103/blog/index.php

并且这些URI正常工作。

我想在Windows中配置虚拟主机,因此可以在浏览器中编写如下内容: http://gastos.web.com http://blog.web.com

并显示来自Ubuntu Web服务器的网站。因此,我在Windows / system32 / drivers / etc / hosts文件中添加了这2个网址:

    ....

    # localhost name resolution is handled within DNS itself.
    #   127.0.0.1       localhost
    #   ::1             localhost

    192.168.56.103/gastos/index.php gastos.web.com
    192.168.56.103/blog/index.php blog.web.com

但是,当我在Windows(主机)浏览器中编写URL(gastos.web.com或blog.web.com)时,它显示的是Apache起始首页,但没有网站(gastos或博客)

我做错了什么? 谢谢!

0 个答案:

没有答案
相关问题