Starting WEB2Py over network

1,165 views
Skip to first unread message

Seelife

unread,
Dec 13, 2012, 3:42:56 AM12/13/12
to web...@googlegroups.com
Hi Folks, If this is a basic question, my apologies.
I have an App Ive built in web2py.  Ican run on my local computer or place the whole web2py installation on a shared network disc, access web2py.exe and start up the browser & open my app and all works fine.

But here are the questions :
How do I start web2py from a networked windows machine so that it opens both web2py and my app only

I would like to open the App on at least 2 machines. 
I assume that I would open one instance of web2py with srat parameters that allow it to "listen" to other requests.
Can someone give me simple stupid examples as to how to open the first machine and get web 2py running with my app, then what webaddress or whatever to open the second machine to access the app.
There should be no problems in record locks as it is purely a logging data app.

I am not a network expert, so please give me a simple way to open on a windows desktop.
Thank heaps

Massimo Di Pierro

unread,
Dec 13, 2012, 9:33:52 AM12/13/12
to web...@googlegroups.com
I am not sure I fully understand your quesiton/questions.

if you only want to expose one application you can use damin and disable the other ones.

You choose a host machine and you run it there from ip 0.0.0.0 and port 80.

Other machines in the network can access it at http://<ip>/yourapp assuming <ip> is the host machine.

Seelife

unread,
Dec 14, 2012, 3:24:23 AM12/14/12
to web...@googlegroups.com
Hi Massimo, thanks for responding,  Im sorry if these are basic questions etc.
I have downloaded the standard package web2pywin zip, installed it on my windows computer and all is running well.
I have now transferred that install and the Apps Ive build to a shared workdisk on our work network (windows based).

Now I access web2py.exe and run it as a windows exe file and the initial Framework opens, the web2py server starts and asks for the IP, port & password. If I use the default 127.0.0.1 , 8000 and my password, the browser opens, I can via admin open my App, so far so good.
I can also open the app via http://127.0.0.1:8000/APP/default/index etc etc

If I enter 0.0.0.0 port 80 and my password into the web2py server dialog box, an IE browser page opens but there is no connection to a webpage, so no default just a widows IE error page ie the webpage cannot be found.

If I Open the Windows Run command and enter python web2py.py -a 'pword' -i 0.0.0.1 -p 80 I get an error (I guess cos its on a folder)
If I try to use the path and command eg S:\Kul\<path to the shared disc etc>\BBDB python web2py.py -a 'bb999' -i 0.0.0.1 -p 80
Then I also get an error.

Some of our computers are more tightly firewalled, however, I am generally able to navigate to the web2py.exe and run the windows exe and open the rocket server & start the web2py admin.

So, If that is clearer? These are local machines using the web2py Rocket server on a standard windows computer (across a network)
as per the documentation ......

On Windows, run: web2py.exe
On OS X, run:open web2py.app
On Unix and Linux, run from source by typing:python2.5 web2py.py

So, While I would love to put it on a Unix system, but I dont have that option (its not allowed).
So, how can I start web2py using rocket so that I can open the server & allow another different local machine to then open the app.
I understand that I should be able to once rocket is open in 0.0.0.0:80, then I can (hopefully) navigate to the app.
I guess that I will have to know the IP of that "shared disk" .. OR ... is there a better way.

Thanks for the simple replies, Im not a networker or programmer, I just use the computers :)

Niphlod

unread,
Dec 14, 2012, 4:05:05 AM12/14/12
to web...@googlegroups.com
0.0.0.0 is not a real address.... 0.0.0.0 is a "fake" address (but somewhat standard) to say "listen on all network interfaces".
Normally you have a computer running web2py on 0.0.0.0 (for the sake of the example, on port 8000) that can access "itself" (meaning, from the same computer) web2py at http://127.0.0.1:8000 (that's the default address for "local").
Other computers needing to connect to this computer must know the ip address of that computer (or the name): so, if your computer running web2py has an ip address of, let's say, 192.168.1.15 (192.168.* or 10.* are the most common addresses used in LANs), other computers can connect to web2py opening the browser at http://192.168.1.15:8000, or http://nameofthehost:8000

To know the address of the computer running web2py, just see the details on the network connection: alternatively, open a dos window and type "ipconfig": that command list all available network interfaces.

Seelife

unread,
Dec 14, 2012, 5:47:51 AM12/14/12
to web...@googlegroups.com
Hi Niphlod, thanks for the hints.
I am not sure of the IP address of the network shared disk.  In the meantime I testing running on my local machine in "open listening" and then accessing my machine from elsewhere.

When I start web2py.exe , I get the Web2py framework starting etc, hardcron etc then if I use 127.0.0.1 and 8000 and pword in the dialog, it works but I cannot access the app from elsewhere.
If I use 0.0.0.0 and 8000, the server does not start.
If I use 0.0.0.1 and 80 I get WARNING:Rocket.Errors.Port80:Listener started when not ready... and a webpage error.

I have an IP address to my local machine but at the moment I cant get rocket to run with anything other than 127 etc.
Any suggestions to a total clutz.
Thanks

Nico Zanferrari

unread,
Dec 14, 2012, 6:10:01 AM12/14/12
to web...@googlegroups.com
Hi Seelife.

In order to access your running web2py application from another pc you must use the real IP of your pc (not 0.*, not 127.*). You can find it with the IPCONFIG command in a Command Prompt window. Note that (if firewalls allow it) the other pc's will connect to your pc only, and not with the  network shared disk.
Also, placing the files in a  network shared disk is not at all a suggested configuration.... I cannot see a reason for doing it.

Bye,
Nico


2012/12/14 Seelife <go2...@gmail.com>
--
 
 
 

Seelife

unread,
Dec 14, 2012, 6:27:18 AM12/14/12
to web...@googlegroups.com
Hi Nico, thanks for input.
yes I know I need to use the IP of my computer so others can access the running App.
As I said, I am at the moment just running it on my local computer, my work desktop.  I should then be able to access the app by opening the web address of my computer (IP) and run the app from a separate computer on the network.
So my app would then be on my local computer as a "server" ie on : http://nnn.nnn.nnn.nnn:8000/App/default/index where n is MY local IP address.  Thats fine, but I cant get rocket to open in listening mode - at least thats the way I understand it.
I cannot get web2py (on windows) to open in anything other than the default 127.0.0.1:8000 setup in framework and that seems to be "local" - unless Im missing something........ & thats possible

As for the shared disk... this is a hospital network.
We are not allowed to load to or use the servers for anything other than authorised systems for good reason.
However, we do have "shared" disk areas that would be accessible by other workstations on the hospital network.
To get any pilot app system running I need to be able to run it somehow across the network.
Once running, I can then move it on a "secure" disk and the IT guys would hopefully help in setting the access and give me the IP to that disk - whatever it is.  Hope that is clearer.
yes I would rather have the thing on the web on a server, but we're not allowed.
Regards
Message has been deleted

Nico Zanferrari

unread,
Dec 14, 2012, 8:06:09 AM12/14/12
to web...@googlegroups.com
Can I suggest you to use the free PythonAnywhere web site for your design / test phase? Of course it is not feasible for your privacy needs, but it is something you can play on easily from everywhere.

Anyhow, you must run it with 0.0.0.0:8000 in order to have it visible from other PCs. Then use http://your.real.ip:8000 to reach it.

Nico


2012/12/14 Seelife <go2...@gmail.com>
--
 
 
 

Seelife

unread,
Dec 14, 2012, 8:54:07 AM12/14/12
to
Hi Folks, Ok at least some progress.
I can get rocket to work with 0.0.0.8000 on my computer, and then open the app with http://myip/app/etc etc
But if I try to open that app now by accessing my computer from a second computer via the IP then the page is blocked I guess by the network firewall.'
Cos we dont have admin control of our computers we cant turn off or modify the firewall (yet).
Any ideas what to do to access from behind firewalls?
thanks


On Thursday, December 13, 2012 9:42:56 AM UTC+1, Seelife wrote:

Seelife

unread,
Dec 17, 2012, 2:54:51 AM12/17/12
to web...@googlegroups.com
Hi Folks, can anyone suggest a way to deal with firewalls and run rocket so that we can share the App?
my usual error when rocket tries to open the welcome page is :

Traceback (most recent call last):
File "gluon/restricted.py", line 205, in restricted
File "F:/Web2Py/applications/welcome/models/db.py", line 14, in <module>
File "gluon/dal.py", line 5968, in __init__
RuntimeError: Failure to connect, tried 5 times:
I can open the admin area and edit the apps etc, just not run the app or welcom... frustrating.

Thanks heaps...


On Friday, December 14, 2012 2:53:18 PM UTC+1, Seelife wrote:
Hi Folks, Ok at least some progress.
I can get rocket to work with 0.0.0.8000 on my computer, and then open the app with http://myip/app/etc etc
But if I try to open that app now by accessing my computer from a second computer via the IP then the page is blocked I guess by the network firewall.'
Cos we dont have admin control of our computers we cant turn off or modify the firewall (yet).
Any ideas what to do to access from behind firewalls?
thanks

On Thursday, December 13, 2012 9:42:56 AM UTC+1, Seelife wrote:
Reply all
Reply to author
Forward
0 new messages