Is it possible to access my apache server from the name of my machine?

0

I'm going to give an example of the Apache + PHP + MySQL server I have on my Ubuntu 16.04 machine, I know that if I put it in the address bar of my phone's browser I can access my sites from the / var / www folder / html , but could I access from the name of my machine?

    
asked by anonymous 27.10.2017 / 21:04

1 answer

0

On your machine, edit the file /etc/hosts by adding the following line at the end:

127.0.0.1    minhamaquina

Then just access your browser link

The / etc / hosts file configures domain names on your system, since trying to resolve the name minhamaquina it will first check your file and will not search the "external network"

Ah! And to work on your mobile the process is the same, but I believe you have to be root on Android to achieve this. And, instead of using ip 127.0.0.1 you can put any IP, so other computers on your local network can also use your custom domain.

And in Windows it works the same, but the file stays in C:\Windows\System32\Drivers\etc\hosts

    
27.10.2017 / 21:12