networking - Local Network web site access with multiple computers

08
2014-07
  • Dimitri

    I have a local site running through my server computer located at 192.168.2.111 (port 80) on my network. I'm currently running the site using XAMPP. In order for the site to be accessed, I have created an alias which the users would use to type in the URL.

    In order for this alias to be resolved, I needed to modify the Windows hosts file and append the following (on the server computer running Apache etc.):

    127.0.0.1 www.mysite.com

    Now, the problem starts when other local computers need to access this site. I had modify the host file for each computer on the network to point to the server in order for the address to be resolved:

    192.168.2.111 www.mysite.com

    This works like a charm and everyone can access the site. This, however, becomes problematic and tedious when there are 30 computers involved.

    Is there a way to get the same results WITHOUT having to do this for thirty computers? If the Server's IP address were to change, I would need to change it for all computers and want to avoid that.

    Any suggestions would be great!

    Thanks.

  • Answers
  • Adam

    Editing hosts files is a bad way of doing this, for exactly the reason you are encountering. You'll have to setup a DNS server and configure each machine to use your DNS server for domain name lookup. If all of these systems are already on a domain, then you can use your domain controller as the DNS server as well.

    You can read a little about creating a DNS alias record on Windows here.


  • Related Question

    ubuntu - How to forward a public (network-accessible) port to a local (port or host)
  • Omar Dolaimy

    I'm using Ubutnu 9.04, and XAMPP as a testing server for my websites. What I want to do is make my websites network-accessible. For now only the my-ip-address:80 is accessible and managed by XAMPP.
    But I want to add more ports like my-ip-address:41100 for example and make it forwarding to a specific local host like (my-custom-domain.local) which I made by editing/configuring on /etc/hosts file and also /opt/lampp/etc/extra/httpd-vhosts.conf.

    Thanks


  • Related Answers
  • 8088

    Finally I found a solution:

    1. Make Apache listen to multiple ports like (44100, 44101, ..., 44199) because it's unused/unregistered ports. [you can edit httpd.conf of ports.conf to do this]

    2. Allow incoming connections to these ports.

    3. Add new virtual hosts and configure Apache to use these ports for those hosts (each host corresponds to one port).