Accessing local GAE SDK server from another computer in the network
Asked Answered
W

4

13

I have development server (from google appengine sdk), running on my Ubuntu computer. I can access my site by navigating to localhost:8080

I want to access that site from another computer (with Vista OS) in the network.

ifconfig prints the following (snippet):

eth1 Link encap:Ethernet HWaddr 00:1f:e1:c5:30:cf
inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::21f:e1ff:fec5:30cf/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:39204 errors:0 dropped:0 overruns:0 frame:46271 TX packets:26198 errors:6 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:25876770 (25.8 MB) TX bytes:4566161 (4.5 MB) Interrupt:17 Base address:0xc000

I thought that I should just type http://192.168.1.103:8080 on my second machine to access the server, but that doesn't work.

I can share files in my home network successfully, so my Vista machine can navigate some directories in my Ubuntu machine, but I can't access the server.

What should I try next? Do I have to configure router in some way?

Thanks in advance.

Whalen answered 16/8, 2010 at 18:37 Comment(2)
Have you tried pinging the machine just as a sanity check?Newhouse
People finding this question might be interested in How do I connect to this localhost from another computer on the same network?.Egotism
P
11

If you're using Python:

sudo python2.5 dev_appserver.py -a 192.168.1.103 -p 8080 myapp/

Edit:
The development server also happens to listen to port 8080 by default, so that 2nd argument is redundant.

Princedom answered 16/8, 2010 at 18:41 Comment(6)
indeed: you have probably at least two network interfaces running: eth1 (with the IP address 192.168.1.103) AND the loopback interface (with the IP address 127.0.0.1). So you have to make sure that your application binds to 192.168.1.103 (eth1) and not to 127.0.0.1 (the loopback interface which is not visible from outside the box)Rostrum
Thank you very much! It works fine now. Just a small note: there is a typo in the command. It should read: sudo python dev_appserver.py -a 192.168.1.103 -p 8080 myapp/ Thank you both again.Whalen
Ahh, thanks! I had this same issue and the '-a' flag solved it!Lydialydian
For me norkben's suggestion with "-a 0.0.0.0" works fine (running GAE devserver on a Mac, OS X Lion), and is even simpler as one does not need to put in the exact IP in the dev_appserver-command.Tenor
Good answer. Although I had to use norskben's suggestion as well. I'm running ubuntu 12.04 on as a virtual machine through VirtualBox. Binding to the exact address resulted in an error "could not bind to address". using -a 0.0.0.0 did the trick though.Antietam
Awesome! Solved my problem. If you use the App Engine Launcher instad of the command line, you can add the -a flag to the configuration by selecting your application, going to Edit > Application Settings... and putting -a <IP address> in the Extra Flags box.Rhyton
S
3

The first check is indeed the ping check

ping 192.168.1.103

As said by Andre Holzner, I too feel the same possibility. You can easily check this by opening file /etc/hosts. sudo vi /etc/hosts.

If you see following entries,

127.0.0.1 localhost localhost.localdomain

192.168.1.103

then simply comment the 1st line and restart your web application.

Check if now you can connect it through other machine.

Shrivel answered 16/8, 2010 at 19:4 Comment(0)
A
3

for an appengine specific solution see this: http://thecoderscanon.com/?p=115.

Just add the Extra Flags: "-a 0.0.0.0"

Antisana answered 28/8, 2011 at 13:16 Comment(0)
H
1

Make sure that you have the port 8080 open in Ubuntu's firewall settings.

This is most likely a firewall issue on your linux box.

Hooligan answered 16/8, 2010 at 18:41 Comment(1)
Ubuntu by default has no firewall...so I'm not sure about thatCongressman

© 2022 - 2024 — McMap. All rights reserved.