A
A
Anton Dyshkant2014-03-07 11:32:23
linux
Anton Dyshkant, 2014-03-07 11:32:23

How to organize access to virtual hosts from the local network and from the outside without using the hosts file?

The other day I asked a question on the same topic , now I'm interested in continuing.
In general, there is a local network, there is a local machine on which ubuntu is installed, under which Apache runs with a number of virtual hosts.
At the moment, access to virtual hosts from the local network is carried out by prescribing the appropriate rules in the hosts file: "127.0.0.1 site.local", and "ServerName site.local" is specified in the virtual host configs.
The question is: how to make sure that all machines in this local network have access to all virtual hosts declared in Apache at once without prescribing the "127.0.0.1 site.local" rules on each local machine in the hosts file .
On the router through which this locale accesses the Internet, it is planned to forward the 80th port to the Apache machine, i.e. it is also necessary to ensure the possibility of getting to virtual hosts from the outside.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Petrov, 2014-03-07
@vyshkant

You need to raise the DNS server inside the network, create the necessary "A" records in it (host, ip). (Register this DNS server to all machines on the network or assign it via DHCP)
Further, after forwarding port 80, you need to create, for example, subdomains (DNS management) with an external registrar while specifying your external router ip. The most important condition for this whole undertaking is that you have a permanent IP (real, static) and the ability to manage the DNS zone with your registrar

I
Igor Yatsevich, 2014-03-07
@IgoNsk

By raising the VPN network and setting up your own DNS in it, in which the necessary domains are registered.
Accordingly, those who need it connect to this VPN and get access to the necessary resources. This is how the security problem is also solved, if it is necessary to close resources for everyone except for someone and the list.

I
Ivan Starkov, 2014-03-07
@icelaba

Set up a local DNS server, register it on the router
External users still change hosts

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question