0

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!

2 Answers2

0

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

  • 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 :) –  Jun 05 '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. –  Jun 05 '11 at 21:26
0

You can't use "_" in server name