如何在本地网络中远程访问自定义 wampserver 的虚拟主机? [英] How to remotly access a custom wampserver's virtual host in a local network?

查看:51
本文介绍了如何在本地网络中远程访问自定义 wampserver 的虚拟主机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 windows 10 下使用 Wampserver 3.0.6 并且我想在我的个人 PC(主机)和链接到同一家的其他一些计算机之间共享我的应用程序网络(客户端).

I use Wampserver 3.0.6 under windows 10 and I want to share my application between my personal PC (The host) and some other computers linked to the same home network (Clients).

我更改了 httpd-vhosts.conf 文件中的一行,让网络中的其他机器可以访问该应用程序:

I changed a line on httpd-vhosts.conf file to let the application be accessible from other machines in the network from this:

Require lacal

为此:

Require all granted

问题是默认虚拟主机 (localhost) 可以从这些客户端使用主机的 IP 地址访问,例如 192.168.###.###/但不是我定制的虚拟主机(本例中的 tilelli).下面是 httpd-vhosts.conf 文件的内容:

The problem is that the default virtual host (localhost) is accessible from those clients using the host's ip adress like this 192.168.###.###/ but not my customized virtualhost (tilelli on this case). Here is the content of httpd-vhosts.conf file now:

在此处输入图片说明

我尝试通过 192.168.###.###/tilelli/ 和直接通过 tilelli/ 访问它,但没有成功.

I tried to access it via 192.168.###.###/tilelli/ and directly via tilelli/ but didn't work.

有人可以帮我吗?

推荐答案

如果您将虚拟主机服务器名称定义为 tilelli,那么 Apache 将在连接请求中看到该域名时为该站点提供服务,即http://tilelli.

If you define a Virtual Host Servername as tilelli then Apache will serve that site when it sees that domain name in the connection request i.e. http://tilelli.

如果您有本地(公司)DNS 服务器,请向其中添加该域,指向您的 WAMPServers PC 的 IP 地址.如果您没有本地 DNS 服务器,请更改需要查看此服务器的 PC 上的 HOSTS 文件,以便他们知道在哪里寻找它

If you have a local (company) DNS Server, add that domain to it, pointing to your WAMPServers PC's IP Address. If you dont have a local DNS Server, then change the HOSTS file on the PC's that need to see this server so they know where to look for it

主机文件

192.168.xxx.yyy tilelli 

不幸的是,您确实必须更换每台 PC.

You do have to change each and every one of the other PC unfortunately.

这篇关于如何在本地网络中远程访问自定义 wampserver 的虚拟主机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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