1
votes

I have a Linux (debian7) and i run a lot of different virtual hosts (for all my projects) - apache2 ,and i usually use my development server to test new features via mobile devices (for mobile devices) ,but that takes to long.How can i set-up my config on my Linux so i can access the virtual host from my mobile device (on the same network - WiFi).

I've found several similar topic here on SO and else ware,but i had no success implementing them.(i am fairly new to Linux).

My standard .conf file looks like this :

<VirtualHost *:80> 
     ServerName lorem.ipsum
     ServerAlias lorem.ipsum
     DocumentRoot /home/user_name/Projects/lorem.ipsum/
     ErrorLog /home/user_name/Projects/errors_log/lorem.ipsum/
</VirtualHost>
1

1 Answers

1
votes

since the mobile device does not know where to go if you write "lorem.ipsum" in its address bar, you need to add the ip and dns to the mobile device's host file. for android you can use the app "Hosts Editor" from playstore for that purpose.

  • IP: IP of your debian server
  • HOST: lorem.ipsum

it should work then.

[add] you can get the ip of your linux PC from the command line, just type

ifconfig

in console and look for the IP of (usually) eth0. something like 192.168.xxx.xxx should be ok.