can webpy server run by itself?

22 views
Skip to first unread message

geekbuntu

unread,
Nov 7, 2009, 9:41:24 AM11/7/09
to web.py
right now i have a terminal window running my webpy app - is there a
way to make it run by itself - not dependent on it being executed
manually? (like a standard webserver)

Alessandro Agosto

unread,
Nov 7, 2009, 3:40:18 PM11/7/09
to web.py
Hi,
have you tried to add the command as a service? On windows I don't
have idea, but on *nix system you should be able to add some commands
to daemons like inet.d or something like this. Some systems like GNU/
Linux Ubuntu provide a more user-friendly interface to do that without
modify any file manually.
Google can help you :-)
Otherwise you can do a script that does necessary steps to do that.
Greetings,
Alessandro.

Greg Milby

unread,
Nov 7, 2009, 4:10:14 PM11/7/09
to we...@googlegroups.com
actually, i've never used it, but i think webmin will do that.  i'll give it a try - thank you.

Alessandro Agosto

unread,
Nov 7, 2009, 4:42:59 PM11/7/09
to web.py


On Nov 7, 10:10 pm, Greg Milby <gmi...@gmail.com> wrote:
> actually, i've never used it, but i think webmin will do that.  i'll give it
> a try - thank you.
>
> On Sat, Nov 7, 2009 at 3:40 PM, Alessandro Agosto <the.6o...@gmail.com>wrote:
>
>
>
> > On 7 Nov, 15:41, geekbuntu <gmi...@gmail.com> wrote:
> > > right now i have a terminal window running my webpy app - is there a
> > > way to make it run by itself - not dependent on it being executed
> > > manually? (like a standard webserver)
> > Hi,
> > have you tried to add the command as a service? On windows I don't
> > have idea, but on *nix system you should be able to add some commands
> > to daemons like inet.d or something like this. Some systems like GNU/
> > Linux Ubuntu provide a more user-friendly interface to do that without
> > modify any file manually.
> > Google can help you :-)
> > Otherwise you can do a script that does necessary steps to do that.
> > Greetings,
> > Alessandro.
:-)
If you solve, please let us know how you've done.
So you will help who has your same problem.
Greetings,
Alessandro.

Greg Milby

unread,
Nov 7, 2009, 4:57:09 PM11/7/09
to we...@googlegroups.com
i'm working on it. it seems ubuntu has changed how they add a new service (now called startups rather than the inet.d setup start script... ).  ubuntu has so much support, but it gets confusing between the versions...

Alessandro Agosto

unread,
Nov 7, 2009, 5:21:03 PM11/7/09
to web.py


On Nov 7, 10:57 pm, Greg Milby <gmi...@gmail.com> wrote:
> i'm working on it. it seems ubuntu has changed how they add a new service
> (now called startups rather than the inet.d setup start script... ).  ubuntu
> has so much support, but it gets confusing between the versions...
>
Yeah, you're right.
I talk for general unix systems but Canonical has developed its own
daemon called Upstart to replace /sbin/init, but i think that this
does not change the way to set up new services using graphical tools -
sessions-.

Alessandro Agosto

unread,
Nov 7, 2009, 5:25:42 PM11/7/09
to web.py


On Nov 7, 10:57 pm, Greg Milby <gmi...@gmail.com> wrote:
> i'm working on it. it seems ubuntu has changed how they add a new service
> (now called startups rather than the inet.d setup start script... ).  ubuntu
> has so much support, but it gets confusing between the versions...
>
I forgot to say that probably docs refers to more version of ubuntu
because essentially the control panels are like previous versions, and
they don't rewrite all documentation but only about new features. But
i'm not sure.
There's not Windows that change by any version -not really, but they
can always create new problems-.

Angelo Gladding

unread,
Nov 7, 2009, 10:07:26 PM11/7/09
to we...@googlegroups.com
I use `screen` and keep my web.py app long-running on a secondary screen during development. I can toggle to it to catch debug and/or restart when `web.reloader` might not be sufficient. I don't lose any screens upon killing my local terminal. After a local reboot or a drop in the connection I can simply `screen -r` to resume my session. I can point you down the right path if this will help your particular situation.

Otherwise, are you talking about daemonizing your app? For stability and performance you likely don't want to do this but if your situation calls for it — http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

Let me know if that helps.
--
Angelo Gladding
ang...@gladding.name
http://angelo.gladding.name/
E69E 47E8 5C3A 96E5 C70F
D931 F35C ACBA 6F39 9611

Greg Milby

unread,
Nov 8, 2009, 4:18:53 AM11/8/09
to we...@googlegroups.com
that seems very though (self-checking & all) - thank you

Wesley Chow

unread,
Nov 8, 2009, 10:11:13 AM11/8/09
to we...@googlegroups.com

Has anybody suggested simply running it via Apache with mod_python,
mod_wsgi, or Lighttpd and fcgi? Seems like the more straightforward
thing to do.

Wes


>
> On Sat, Nov 7, 2009 at 6:41 AM, geekbuntu <gmi...@gmail.com> wrote:
>
> right now i have a terminal window running my webpy app - is there a
> way to make it run by itself - not dependent on it being executed
> manually? (like a standard webserver)
>
>
>
>
>
> --
> Angelo Gladding
> ang...@gladding.name
> http://angelo.gladding.name/
> E69E 47E8 5C3A 96E5 C70F
> D931 F35C ACBA 6F39 9611
>
> >

---
http://www.s7labs.com | http://standingrm.com

jlist9

unread,
Nov 8, 2009, 12:18:54 PM11/8/09
to we...@googlegroups.com
I suppose you'll need to do the same for lighttpd? I don't remember
it makes itself a service automatically.

Greg Milby

unread,
Nov 8, 2009, 12:33:44 PM11/8/09
to we...@googlegroups.com
if memory serves, i think i saw 'setup instructions' for these options on the webpy site... i will probably trying everything - see what works best (for me). thanks for replying.

Angelo Gladding

unread,
Nov 8, 2009, 12:54:02 PM11/8/09
to we...@googlegroups.com
Do you desire to use a webserver? If so, installing lighttpd or Apache using your standard package manager, apt-get for ubuntu, will do the dirty work of setting up your Upstart or /etc/init.d.

To be clear, this is the advisable method of deployment.

Greg Milby

unread,
Nov 8, 2009, 1:15:38 PM11/8/09
to we...@googlegroups.com
i have apache installed, but i'm not sold on apache with wsgi (from the little i've read on it [people say it creates a lot of load/threads/bulk and the memory is not handled well by apache])... on the other hand, if i remember correctly, i heard that lighttpd did great... if running them in tandem will not cause any problems, i may do that (each on it's own port) 

Leon Waldman

unread,
Nov 8, 2009, 1:44:52 PM11/8/09
to we...@googlegroups.com
One Word?

Nginx! :)

Is what I'm using in production.

--
Leon Waldman
SysAdmin Linux - Arquiteto de Infra-Estrutura & TI.

Graham Dumpleton

unread,
Nov 8, 2009, 4:42:08 PM11/8/09
to web.py


On Nov 9, 5:15 am, Greg Milby <gmi...@gmail.com> wrote:
> i have apache installed, but i'm not sold on apache with wsgi (from the
> little i've read on it [people say it creates a lot of load/threads/bulk and
> the memory is not handled well by apache])...

That is FUD.

If you configure Apache/mod\_wsgi appropriately there is no problem
and is comparable to other solutions.

People who say that tend to be people who can't be bothered to read
documentation properly and set up their systems in a sensible way for
the type of application they run.

For a description of some of the issues that can come up due to poor
choice of configuration see:

http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html

In short, ensure your application is thread safe, use worker MPM for
Apache and daemon mode for mod_wsgi and you shouldn't have an issue.
If in a memory constrained system or what to get the most out of
Apache/mod_wsgi then use a nginx front end to handle static files and
proxy to Apache/mod_wsgi. This gives better static files sharing
performance and isolates your web application running on back end
server from slow HTTP clients.

Graham

> on the other hand, if i
> remember correctly, i heard that lighttpd did great... if running them
> in tandem will not cause any problems, i may do that (each on it's own
> port)
>
> On Sun, Nov 8, 2009 at 12:54 PM, Angelo Gladding <ang...@gladding.name>wrote:
>
>
>
> > Do you *desire* to use a webserver? If so, installing lighttpd or Apache
> > using your standard package manager, apt-get for ubuntu, will do the dirty
> > work of setting up your Upstart or /etc/init.d.
>
> > To be clear, this is the advisable method of deployment.
>
> > On Sun, Nov 8, 2009 at 9:33 AM, Greg Milby <gmi...@gmail.com> wrote:
>
> >> if memory serves, i think i saw 'setup instructions' for these options on
> >> the webpy site... i will probably trying everything - see what works best
> >> (for me). thanks for replying.
>

Greg Milby

unread,
Nov 8, 2009, 5:00:53 PM11/8/09
to we...@googlegroups.com
i wasn't trying to offend - i did say "from what i've heard" - too new at wsgi to know much first hand.  at the mercy of my peers atm

Graham Dumpleton

unread,
Nov 8, 2009, 5:17:36 PM11/8/09
to web.py


On Nov 9, 9:00 am, Greg Milby <gmi...@gmail.com> wrote:
> i wasn't trying to offend - i did say "from what i've heard" - too new at
> wsgi to know much first hand.  at the mercy of my peers atm

No offence taken. Just wanted to cut off the misinformation before it
gets out of hand.

Part of the problem is that people see all these comments and even if
they don't know for sure whether it is true, may echo further
questions about it and so one gets more and more people asking about
or suggesting there is a problem without knowing the facts. Over time
the weight of discussion simply makes it appear there is a problem and
people start believing it is fact.

Graham


> On Sun, Nov 8, 2009 at 4:42 PM, Graham Dumpleton <graham.dumple...@gmail.com
>
>
>
> > wrote:
>
> > On Nov 9, 5:15 am, Greg Milby <gmi...@gmail.com> wrote:
> > > i have apache installed, but i'm not sold on apache with wsgi (from the
> > > little i've read on it [people say it creates a lot of load/threads/bulk
> > and
> > > the memory is not handled well by apache])...
>
> > That is FUD.
>
> > If you configure Apache/mod\_wsgi appropriately there is no problem
> > and is comparable to other solutions.
>
> > People who say that tend to be people who can't be bothered to read
> > documentation properly and set up their systems in a sensible way for
> > the type of application they run.
>
> > For a description of some of the issues that can come up due to poor
> > choice of configuration see:
>
> >http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usa...
Reply all
Reply to author
Forward
0 new messages