How to access a local virtualhost from another device?

Asked

Viewed 350 times

1

I’m needing to test a local application that runs on Apache2 on my mobile and other devices here.

I usually configure my Apache2 on Linux as follows:

In the /etc/hosts, I place the desired domain:

  127.0.0.1 dev.local

And on Virtualhost, I set the same:

<VirtualHost *:80>
     ServerName dev.local
     DocumentRoot  /var/www/dev.local/public
</VirtualHost>

These are the settings I use, but I wanted to know if there was any way to expose this Virtualhost dev.local for other machines to access the same.

I even have a solution that I managed, which is to give a bind in 0.0.0.0 with a port and use my local ip to access via device, but it takes too long to load the page.

Does anyone have any idea how to do that?

  • At home I have a Mikrokit and basically I have the same environment as you, I added a static DNS, which directs to the ip of my apache server. your Gate is a linux or a Mikrotik ? or a more rugged router ?

  • @Bulfaitelo I’m using a wi-fi? It would be possible to do via wi-fi?

  • In my case any way I can access the server. yes by wifi, but for that I need to understand your environment,

1 answer

3


I know and tested the tool ngrok. With it you expose your door to access an internet address. I’ve never used it professionally, just for home testing, but I believe you can test your development server. It provides two addresses at http and one at https.

Edit

I found this reply in the English OS indicating two more services that do the same:

http://localtunnel.me/

http://localhost.run/

  • Interresante, I’ll take a look.

Browser other questions tagged

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