Access virtual host of another computer in same network

apache-2.2networkingsubnetxampp

I made a PHP/MySQL app in my desktop that I access using Apache vhosts (XAMPP). In my host file I added 127.0.0.1 myapp so all I have to type in my browser is http://myapp. How can I access this same webpage but from another computer in the same wifi network?

I've also already allowed port 80 on my firewall for my subnet based on this post. This is my first time doing this so I'm on unfamiliar ground. My computer's ip (the one hosting it) is 192.168.254.100.
Here's what my httpd-vhosts.conf file looks like:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot D:/xampp/virtual/myapp/public
    ServerName myapp

    <Directory "D:/xampp/virtual/myapp/public">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Best Answer

On the other computer you could access it from the ip by doing http://192.168.254.100 or if you want the other computer to be able to just type http://myapp you would need to modify the other computer's hosts file to have an entry of 192.168.254.100 myapp.

Related Topic