My fcgihandler.py equivalent file is in the the same directory as
web2py.py

My init.d startup script changes to this directory before running
fcgihanfdler.py with Python.

I don't make any separate changes to PYTHONPATH.

The web2py FastCGI server needs to know where the UNIX socket is. This
is what I use:

BIND_ADDRESS='/tmp/fcgi_handlerzgus.sock'

John Heenan


On Feb 12, 9:50 am, raven <ravenspo...@yahoo.com> wrote:
> Thanks for the details on modifying the lighttpd configuration file.
> Actually, I am pretty confident about doing this, having modified it
> to connect to fossil.
>
> However, I am confused by  fcgihandler.py
>
> It says:
>
> This file has to be in the PYTHONPATH
>
> What does this mean?  The file has to be moved?  Or the web2py folder
> has to be added to the path?  How do I modify the PYTHONPATH - 'echo
> $PYTHONPATH' gives me nothing.
>
> On Feb 11, 6:37 pm, John Heenan <johnmhee...@gmail.com> wrote:
>
> > Yes the instructions are confusing.
>
> > Following are sections from my /etc/lighttpd/lighttpd.conf file. I
> > have edited sections to remove irrelevant detail.
>
> > The lighttpd remaps help to avoid ugly URLs. I don't use a routes.py
> > file but the zgus app does include some helpers to avoid ugly URLs
> > (this gives me more control than using routes.out of routes.py).
>
> > John Heenan
>
> > server.modules              = (
> >             "mod_access",
> >             "mod_alias",
> >             "mod_compress",
> >             "mod_rewrite",
> >             "mod_fastcgi",
> >             "mod_cgi",
> >             "mod_redirect",
> >             "mod_accesslog",
> >             "mod_status",
> > )
>
> > fastcgi.server = (
> >      "/handlerzgus.fcgi" => (
> >         "handlerzgus" => ( #name for logs
> >           "check-local" => "disable",
> >           "socket" => "/tmp/fcgi_handlerzgus.sock",
> >         )
> >      ),
> > )
>
> > $HTTP["host"] =~ "(^|\.)zgus\.com$" {
> >   server.document-root="/home/zgus/web2py/web2py"
> >   $HTTP["host"] =~ "^.*$" {
> >     url.rewrite-once = (
> >       "^(/.+?/static/.+)$" => "/applications$1",  # +? for a non
> > greedy + (one or more) match
> >       "^(/static/.+)$" => "/applications/zgus$1",  # +? for a non
> > greedy + (one or more) match
> >       "^/$" => "/handlerzgus.fcgi/zgus/default/index", #must use /
> > even when none in URL
> >       "(^/zgus.*)$" => "/handlerzgus.fcgi$1",       # app
> >       "(^/admin.*)$" => "/handlerzgus.fcgi$1",      # app
> >       "(^/examples.*)$" => "/handlerzgus.fcgi$1",   # app
> >       "(^/welcome.*)$" => "/handlerzgus.fcgi$1",    # app
> >       "(^|/.*)$" => "/handlerzgus.fcgi/zgus/default/$1",
> >     )
> >   }
>
> > }
>
> > On Feb 12, 9:06 am, raven <ravenspo...@yahoo.com> wrote:
>
> > > Thanks for the info.
>
> > > I use lighttpd for my static web pages, and for hosting  fossil.  It
> > > uses very little memory.
>
> > > I am looking into using it with web2py, but the instructions are a bit
> > > confusing.  I will tackle it again.
>
> > > Removing the imports certainly seems to save huge amounts of memory.
>
> > > On Feb 11, 5:59 pm, John Heenan <johnmhee...@gmail.com> wrote:
>
> > > > How about web2py in a VPS using less than 40MB RAM?
>
> > > > You can reduce web2py memory usage by using a newer generation web
> > > > server with web2py instead of the internal web server with web2py.
>
> > > > Apache gets trashed in tests by newer generation web servers such as
> > > > lightttpd and nginx. Apache also uses far more memory.
>
> > > > The reason is simple. Apache services each request with a thread.
> > > > Nginx amd lightttpd service each request with an event model.
>
> > > > I only use lightttpd for static pages and to remap URLs.
>
> > > > This is my memory usage with lighthttpd and web2py from command 'ps
> > > > aux'.
>
> > > > resident memory units are in KB
> > > > virtual memory units are 1024 byte units
>
> > > > lighttpd: resident memory 3660, virtual memory 59568
> > > > python for web2py: resident memory 32816, virtual memory 225824
>
> > > > This is the memory usage of a python console WITHOUT any imports:
> > > > resident memory 3580, virtual memory 24316
>
> > > > John Heenan
>
> > > > On Feb 11, 10:30 pm, raven <ravenspo...@yahoo.com> wrote:
>
> > > > > It seems that everyone is running with Apache and gobs of memory
> > > > > available.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to