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.

What I Want to do: access my zend framework app from other computer in my private lan

e.g: //192.168.x.x/my_app

  • 192.168.x.x is my ubuntu server ip (from ifconfig)
  • my_app is a virtualhost that I set in the server (/etc/hosts and apache2).

In my server if I do //my_app it works.

In another pc if I do //192.168.x.x it shows "It's working" default message but if I do //192.168.x.x/my_app it "Not found on this server"

Server settings

/etc/hosts

127.0.1.1 localhost
127.0.1.1 my_app

/etc/apache2/sites-enabled/000-default

<VirtualHost *:80>
        DocumentRoot "/var/www"
        ServerName localhost:80
</VirtualHost>

<VirtualHost *:80>
        ServerName my_app
        DocumentRoot "/var/www/my_app/public"

        SetEnv APPLICATION_ENV "development"

        <Directory "/var/www/my_app/public">
            DirectoryIndex index.php
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
</VirtualHost>

Hope someone can help me. Thanks!

share|improve this question
add comment

migrated from stackoverflow.com Jun 6 '11 at 13:35

This question came from our site for professional and enthusiast programmers.

1 Answer

Add your ServerName and your IP to another pc's /etc/hosts file. Of course you should have ServerName in your virtualhost file.

share|improve this answer
    
I did that in system32/drivers/etc/host 192.168.x.x my_app but isn't that for using my_app instead of the ip in the browser of my "guest" machine (windows 7 in this case)? Sorry if I'm saying something stupid networks is not strong in my knowledge base :(. Thanks for replying :) –  Andrés C. Jun 5 '11 at 21:09
    
Ok..i'm sooo stupid. Can't tell why but I try again and IT WORKS!! Thanks again, I read that "host thing" in every post over the internet but yours really touch me :P. THANK YOU. –  Andrés C. Jun 5 '11 at 21:26
add comment

Your Answer

 
discard

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