从 LAN 上的任何计算机访问 Apache VirtualHost? [英] Access Apache VirtualHost from any computer on LAN?

查看:34
本文介绍了从 LAN 上的任何计算机访问 Apache VirtualHost?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 httpd.conf 中设置了很多网站作为虚拟主机的 wamp 设置

I have wamp setup with quite a few websites setup as virtual hosts like this in httpd.conf

<VirtualHost 127.0.0.1>
    ServerName project1.local
    DocumentRoot "c:/wamp/project1/"
</VirtualHost>

我在 wamp 机器的主机文件中有这些输入,我可以在那台机器上很好地访问它们.

I have these input in the wamp machine's host file and I can access them just fine on that machine.

127.0.0.1 project1.local

但是,当我尝试在我的 OSX 机器上放置一个条目(192.168.1.101 是 wamp 机器的内部 IP)时,它不会拉起页面.

However, when I try to put an entry on my OSX machine as (192.168.1.101 being the internal ip of the wamp machine) it won't pull the page up.

192.168.1.101 project1.local

我还需要做些什么才能从其他机器上完成这项工作吗?谢谢!

Is there something else I need to do to make this work from other machines? Thanks!

推荐答案

你要么需要 (除了 127.0.0.1),或者干脆使用 将 VH 放在所有地址上.

You either need <VirtualHost 192.168.1.101> (in addition to 127.0.0.1), or simply use <VirtualHost *> to put the VH on all addresses.

这篇关于从 LAN 上的任何计算机访问 Apache VirtualHost?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆