How to access local network site by typing the virtual address (vhost)?

Asked

Viewed 1,814 times

0

Talk personal. All right? Come on! I’ve been using Xampp for a long time to develop, host and access my sites locally. In the folder htdocs create my directories, as default (meusite1, meusite2, meusite3 and so on). From there through the archives hosts and vhosts configure to access each website by typing meusite1.Loc, meusite2.Loc and so on. But that only works if I’m on the PC where Xampp is installed. To access from other devices on the same network, I need to enter the ip or machine name, followed by the folder name (site) that I intend to access (192.168.xx.9/meusite2). So, how do I access each site from another device just by typing the address configured on my vhosts (meusite1.Loc)?

  • you will need to create an IP pro alias of your machine (where the xamp is installed), usually in the hosts file, putting something like: seu.endereco.de.ip meusite1.loc. So in the client machine,when accessing this address will point to the server machine, and there the xampp turns.

  • You need to install a DNS service on the network and configure it to point your test domains to the server in question.

  • 1

    Or, touch the HOSTS of all Pcs. As @bfavaretto said, the solution is a DNS. You can use an external one (the same as your site, but creating an intranet.nomedosite.com.br pointing to the internal IP - will only work for those on the right network) or simply use the existing DNS on most network routers (or the company’s server, if it exists).

  • If it were not the fact of having several, just use the network name of the PC, Since they are virtual, DNS is necessary (or will have to use a gambiarra to differentiate each, as a "selector" via cookie or other mechanism, but there have to touch the application, and may be far from ideal).

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.