授予网络中的所有计算机以访问localhost [英] Give all computers in a network to access localhost

查看:87
本文介绍了授予网络中的所有计算机以访问localhost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我刚刚在我的电脑上安装了apache(使用 easyphp )。

工作正常。但现在我有一个问题。


我家里有一个网络(只是一个普通的家庭网络,所有电脑都连接到这里,所以他们都可以上网)。 br />
是否有可能我的所有计算机都可以在我的计算机上访问本地主机?

Hi

I just installed apache on my computer (with easyphp).
It works fine. But now i have a question.

I have at my house an network (just a normal house network, where all computers are connected to, so they all can acces the internet).
Is it possible that all my computers can get acces to the localhost here on my computer?

推荐答案

您可以设置开发环境一个VM。然后在网络上为该VM分配自己的IP。然后每台机器在HOSTS文件中都有以下内容。


192.168.1.XXX devdomain.com


所以每次访问devdomain.com它将访问VM。
You could setup the the dev environment in a VM. Then assign that VM it''s own IP on the network. Every machine then has the following in the HOSTS file.

192.168.1.XXX devdomain.com

So everytime you access devdomain.com it will access the VM.


对不起,请更好地解释一下,我是新手=)
Iam sorry, please explain it better, i am new to this =)


@Thew,


有几个关于如何去做的可能性。这取决于您的家庭网络的设置方式。


如果您的本地路由器也提供DHCP和DNS服务,那么您可以按现有名称访问本地计算机。


如果没有,那么你需要知道服务器的IP地址。


Windows:

IPCONFIG / SHOW / ALL

Linux

ifconfig


你应该看到一个系统地址 - 它会可能看起来生活中由点分隔的四个小整数。通常它会以192.168开头,但不能保证是这样的。


我们假设你看到192.168.0.4作为你的地址。

如果您在本地没有DNS,则必须使用地址或在hosts文件中输入名称。


通常,您的网址类似于:
@Thew,

There are a few possibilites on how to go about it. It depends on how your home network is set up.

If your local router is also providing DHCP and DNS services, then you can probably access the local computers by their existing names.

If not, then you need to know your server''s IP address.

Windows:
IPCONFIG /SHOW /ALL

Linux
ifconfig

You should see a system address - it''ll probably look life four small integers separated by dots. Typically it''ll start with 192.168 but it is not guaranteed to be so.

Let''s assume you see 192.168.0.4 as your address.

If you don''t have DNS locally, you''re going to have to use the addresses or enter names in the hosts file.

Typically your URLs will look something like:
  • HTTP://localhost/file.php
  • HTTP://192.168.0.4/service/file.php


这篇关于授予网络中的所有计算机以访问localhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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