Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
That doesn't work. Typing the ip does connect but only opens the htdocs folder (localhost folder). Since I'm using virtual hosts, my sites are saved in the folder named 'virtual' (can be named anything). As in my httpd-vhosts.conf file, the path of my site is in D:/xampp/virtual/myapp/public not D:/xampp/htdocs/myapp/public. Got my directions from this post: Set up multiple virtual hosts on XAMPP for windows. –  enchance Sep 16 '12 at 7:47
    
Did you add the entry to your hosts file for myapp and try using myapp instead of IP? The virtual host may only respond to myapp not the IP due to your configuration if apache. –  Lipongo Sep 16 '12 at 13:20
    
Tried what you said...and it worked! Thanks, Lipongo. –  enchance Sep 16 '12 at 14:04
    
Pleasure to help. –  Lipongo Sep 17 '12 at 14:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.