开发者

Can I use Apache servers for a local network?

I would like to write a computer game played by several users sitting in front of different computers. For that I would like to implement a P2P approach.

Now I consider the following situation. I have, let say, 6 computers which build a local network. On every computer I 开发者_高级运维install Apache web server. So, every computer runs a web site. In this context I have several questions:

  1. What will be the web addresses of these web sites? Names of the computers?

  2. Does apache server starts automatically whenever computer starts?

  3. Do I have to install something additional if I want to write "local" web-sites using PHP or Apache is sufficient?

Thank you in advance for any help.


  1. You could use IPs for these websites on different servers e.g. http://196.168.0.5, or modify the hosts files properly direct to the to the respective IPs, this depends on your OS. On a windows network, you could just use the computer name, e.g. http://computername/
  2. On starting, yes and no. Meaning it can be configured to start automatically, how, again this depends on your OS.
  3. Nope, unless your "local" website, sometimes called intranets, has an application that depends on it.

    Just get a good LAMP or WAMP stack, and you're set.

You will also have to configure firewalls on the servers, this again is platform dependent.


In my network I have on my server an apache server. My server is called "server", so I just type in others workstations http://server. Other tip is put in your host files this resolution:

192.168.0.100 server

The IP is just an example, if you have three workstations and want to access them like:

http://machine1
http://machine2
http://machine3

You would have in your host files:

192.168.0.1 machine1
192.168.0.2 machine2
192.168.0.3 machine3

So...

1) Yes, if you set your computers name in your host files like I said above 2) Apache will start automatically if is registered as a service. 3) Yes. Apache is what you need to write local websites using PHP (If you want MySql too, then install it)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜