[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-02-05 Thread Ivan P
Sorry for the delayed response.
I think that usually means that your permissions are not set. Make
sure that uwsgi is running under the same user that owns your web2py
directory. The error is unknown cause web2py cannot open the error
file, because it cannot write it to disc.

On Jan 27, 3:56 pm, Adi  wrote:
> Hi Ivan,
>
> I followed this howto, and when I try to access the application I get
> an internal error thrown by web2py:
> Ticket issued: unknown
>
> Any idea how to read contents of this ticket to debug?
>
> On Jan 15, 3:14 am, Ivan P  wrote:
>
> > Inspired by Phyo Arkar's howto on setting up web2py with Cherokee and
> > FCGI I tried the setup, but was somewhat unsatisfied with the fcgi
> > method and decided to try uWSGI. I am happy I did so, since it proved
> > to be real easy and uWSGI is a real powerhouse and deserves attention
> > of the whole python webdev community. On to the howto.
>
> > I. Compile from source and run the latest uWSGI, 0.9.3 in my case
> > (available herehttp://projects.unbit.it/uwsgi/wiki).
> > 1. Download the source from and unzip.
>
> > 2. To compile you must install packages python-dev and libxml2-dev (at
> > least thats what they are called on a debian-based system)
>
> > 3. When compiling simply run pick a makefile which matches your OS and
> > python version and run something like "make -f Makefile.Linux.Py26".
> > This produces only one executable named uwsgi26, where 26 is my python
> > version. You can put it in /usr/local/bin.
>
> > 5. To run it, you have two options:
>
> > 5a) Create an xml file and call it, for example, config.xml. Put
> > something like this in it:
> > 
> >     /var/web2py/
> >     
> >     wsgihandler
> >     
> > 
> > In this file "pythonpath" is where your web2py directory is and
> > "script" is the file you want to run, in this case its web2py's
> > "wsgihandler.py". Now run uWSGI like this, but replace "www-data" with
> > the owner of your web2py directory, if its the same as your current
> > user omit the sudo command:
> > sudo -u www-data uwsgi26 -s /tmp/uwsgi.sock -C -x config.xml
> > Why you need to change user is because web2py writes things (session
> > data for example) to disc during execution, so the uwsgi process,
> > which runs the web2py code, has to be the owner of the directories
> > that contain the framework. Note that uwsgi now opened a socket we
> > called "/tmp/uwsgi.sock" About other options consult the uwsgi manual
> > or "uwsgi -h".
>
> > 5b) You can omit the xml file and pass all the info via command line,
> > doing that is easy, so consult the uwsgi docs :)
>
> > II. Setting up cherokee (0.99.37 in my case).
> > 1. Install it, run cherokee-admin, go to localhost:9090
>
> > 2. Open "Information Sources" and create a new one with these
> > parameters:
> > Nick: web2py
> > Connection: /tmp/uwsgi.sock
> > Interpreter: uwsgi26 -s /tmp/uwsgi.sock -C -x /path/to/config.xml
> > The interpreter line is why it is a good idea to have your web2py
> > source owned by www-data or the Cherokee server's user - when cherokee
> > runs it, you can be sure that owners of the sources and process match.
> > And of  course put the correct path in.
>
> > 3. Go to "Virtual Servers" and edit the default one, or you can create
> > a new one, but make sure you give it a domain name to avoid conflict
> > (not really sure what happens when they conflict).
>
> > 4. Go to the "Behavior" section and edit the "Default" behavior.
>
> > 5. Set the "Handler" to uWSGI and on the bottom set the information
> > source to "web2py"
>
> > 6. Pick "Hard restart" from the dropdown on the left and click "Save".
> > TO PREVENT HEADACHE READ THIS: I seem to get inconsistent results with
> > these restarts, so if you're doing production it seems to me that one
> > should restart the server manualy (via /etc/init.d/cherokee restart,
> > that is). Or maybe I should RTFM.
>
> > 6. Go to localhost and BAM! (or at least I hope its a bam). veeery
> > easy if all goes smooth.
>
> > "But wait, what about url rewriting?" was my thought, and this caused
> > much confusion, so I'll add a section on that.
>
> > III. Doing some redirection (I'll give few examples due to poor
> > knowledge of regex).
> > Lets redirect "localhost/" to "/myapp/cntrlr/index"
> > 1. Go back to the "Behavior" sect

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-03-01 Thread Ivan P
Could you elaborate? You want those two rules to point to a static
folder?
If that is the case, you would probably add a new regex rule with
something like "^/app/static$", and add a "static" handler to that
rule, and for the handler just pick the directory where the static
files are.

On Feb 27, 1:10 am, Thadeus  wrote:
> What if I want
>
> example.com/app/static
> example.com/app2/static
>
> What exact rule do I use for this situation?
>
> On Feb 24, 12:37 am, GrayMatterComputing 
> wrote:
>
> > Open theCherokeeAdmin -> General -> Server Permissions. There you
> > are :)
>
> > Cherokeewill respond in the priority order you have set for the
> > virtual servers and behaviors. It will evaluate only the first rule in
> > the list that matches. For example, if you had a static content rule
> > for the directory "/static" and web2py was the default, a request for
> > "example.com/stuff" would pass to web2py, while  "example.com/static/
> > stuff" would be evaluated by the static content rule.
>
> > On Feb 22, 2:40 pm, Thadeus Burgess  wrote:
>
> > > How do you tell what usercherokeegets executed as when the server boots 
> > > up?
>
> > > In my typical installation I have a generic user account (like
> > > "servant") that everything server related exists in this home
> > > directory, and it owns everything. With Apache I have to chown/mod the
> > > files so that www-data can read them.
>
> > > I need to use a user account instead of www-data since mercurial is 
> > > involved.
>
> > > As far as static file streaming, doescherokeeintercept web2py file 
> > > serving?
>
> > > Is there a way to tellcherokeeto serve all requests to the "static"
> > > folder without even going through web2py?
>
> > > -Thadeus
>
> > > On Fri, Feb 5, 2010 at 4:45 AM, Ivan P  wrote:
> > > > Sorry for the delayed response.
> > > > I think that usually means that your permissions are not set. Make
> > > > sure thatuwsgiis running under the same user that owns your web2py
> > > > directory. The error is unknown cause web2py cannot open the error
> > > > file, because it cannot write it to disc.
>
> > > > On Jan 27, 3:56 pm, Adi  wrote:
> > > >> Hi Ivan,
>
> > > >> I followed this howto, and when I try to access the application I get
> > > >> an internal error thrown by web2py:
> > > >> Ticket issued: unknown
>
> > > >> Any idea how to read contents of this ticket to debug?
>
> > > >> On Jan 15, 3:14 am, Ivan P  wrote:
>
> > > >> > Inspired by Phyo Arkar's howto on setting up web2py withCherokeeand
> > > >> > FCGI I tried the setup, but was somewhat unsatisfied with the fcgi
> > > >> > method and decided to tryuWSGI. I am happy I did so, since it proved
> > > >> > to be real easy anduWSGIis a real powerhouse and deserves attention
> > > >> > of the whole python webdev community. On to the howto.
>
> > > >> > I. Compile from source and run the latestuWSGI, 0.9.3 in my case
> > > >> > (available herehttp://projects.unbit.it/uwsgi/wiki).
> > > >> > 1. Download the source from and unzip.
>
> > > >> > 2. To compile you must install packages python-dev and libxml2-dev 
> > > >> > (at
> > > >> > least thats what they are called on a debian-based system)
>
> > > >> > 3. When compiling simply run pick a makefile which matches your OS 
> > > >> > and
> > > >> > python version and run something like "make -f Makefile.Linux.Py26".
> > > >> > This produces only one executable named uwsgi26, where 26 is my 
> > > >> > python
> > > >> > version. You can put it in /usr/local/bin.
>
> > > >> > 5. To run it, you have two options:
>
> > > >> > 5a) Create an xml file and call it, for example, config.xml. Put
> > > >> > something like this in it:
> > > >> > 
> > > >> >     /var/web2py/
> > > >> >     
> > > >> >     wsgihandler
> > > >> >     
> > > >> > 
> > > >> > In this file "pythonpath" is where your web2py directory is and
> > > >> > "script" is the file you want to run, in this case its web2py's
> > > >

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-03-01 Thread Ivan P
Make that rule "^/app/static"

On Mar 2, 1:29 am, Ivan P  wrote:
> Could you elaborate? You want those two rules to point to a static
> folder?
> If that is the case, you would probably add a new regex rule with
> something like "^/app/static$", and add a "static" handler to that
> rule, and for the handler just pick the directory where the static
> files are.
>
> On Feb 27, 1:10 am, Thadeus  wrote:
>
> > What if I want
>
> > example.com/app/static
> > example.com/app2/static
>
> > What exact rule do I use for this situation?
>
> > On Feb 24, 12:37 am, GrayMatterComputing 
> > wrote:
>
> > > Open theCherokeeAdmin -> General -> Server Permissions. There you
> > > are :)
>
> > > Cherokeewill respond in the priority order you have set for the
> > > virtual servers and behaviors. It will evaluate only the first rule in
> > > the list that matches. For example, if you had a static content rule
> > > for the directory "/static" and web2py was the default, a request for
> > > "example.com/stuff" would pass to web2py, while  "example.com/static/
> > > stuff" would be evaluated by the static content rule.
>
> > > On Feb 22, 2:40 pm, Thadeus Burgess  wrote:
>
> > > > How do you tell what usercherokeegets executed as when the server boots 
> > > > up?
>
> > > > In my typical installation I have a generic user account (like
> > > > "servant") that everything server related exists in this home
> > > > directory, and it owns everything. With Apache I have to chown/mod the
> > > > files so that www-data can read them.
>
> > > > I need to use a user account instead of www-data since mercurial is 
> > > > involved.
>
> > > > As far as static file streaming, doescherokeeintercept web2py file 
> > > > serving?
>
> > > > Is there a way to tellcherokeeto serve all requests to the "static"
> > > > folder without even going through web2py?
>
> > > > -Thadeus
>
> > > > On Fri, Feb 5, 2010 at 4:45 AM, Ivan P  wrote:
> > > > > Sorry for the delayed response.
> > > > > I think that usually means that your permissions are not set. Make
> > > > > sure thatuwsgiis running under the same user that owns your web2py
> > > > > directory. The error is unknown cause web2py cannot open the error
> > > > > file, because it cannot write it to disc.
>
> > > > > On Jan 27, 3:56 pm, Adi  wrote:
> > > > >> Hi Ivan,
>
> > > > >> I followed this howto, and when I try to access the application I get
> > > > >> an internal error thrown by web2py:
> > > > >> Ticket issued: unknown
>
> > > > >> Any idea how to read contents of this ticket to debug?
>
> > > > >> On Jan 15, 3:14 am, Ivan P  wrote:
>
> > > > >> > Inspired by Phyo Arkar's howto on setting up web2py withCherokeeand
> > > > >> > FCGI I tried the setup, but was somewhat unsatisfied with the fcgi
> > > > >> > method and decided to tryuWSGI. I am happy I did so, since it 
> > > > >> > proved
> > > > >> > to be real easy anduWSGIis a real powerhouse and deserves attention
> > > > >> > of the whole python webdev community. On to the howto.
>
> > > > >> > I. Compile from source and run the latestuWSGI, 0.9.3 in my case
> > > > >> > (available herehttp://projects.unbit.it/uwsgi/wiki).
> > > > >> > 1. Download the source from and unzip.
>
> > > > >> > 2. To compile you must install packages python-dev and libxml2-dev 
> > > > >> > (at
> > > > >> > least thats what they are called on a debian-based system)
>
> > > > >> > 3. When compiling simply run pick a makefile which matches your OS 
> > > > >> > and
> > > > >> > python version and run something like "make -f 
> > > > >> > Makefile.Linux.Py26".
> > > > >> > This produces only one executable named uwsgi26, where 26 is my 
> > > > >> > python
> > > > >> > version. You can put it in /usr/local/bin.
>
> > > > >> > 5. To run it, you have two options:
>
> > > > >> > 5a) Create an xml file and call it, for example, config.xml. Put
> > > > >

[web2py] uWSGI + Cherokee + web2py - a howto.

2010-01-14 Thread Ivan P
Inspired by Phyo Arkar's howto on setting up web2py with Cherokee and
FCGI I tried the setup, but was somewhat unsatisfied with the fcgi
method and decided to try uWSGI. I am happy I did so, since it proved
to be real easy and uWSGI is a real powerhouse and deserves attention
of the whole python webdev community. On to the howto.

I. Compile from source and run the latest uWSGI, 0.9.3 in my case
(available here http://projects.unbit.it/uwsgi/wiki).
1. Download the source from and unzip.

2. To compile you must install packages python-dev and libxml2-dev (at
least thats what they are called on a debian-based system)

3. When compiling simply run pick a makefile which matches your OS and
python version and run something like "make -f Makefile.Linux.Py26".
This produces only one executable named uwsgi26, where 26 is my python
version. You can put it in /usr/local/bin.

5. To run it, you have two options:

5a) Create an xml file and call it, for example, config.xml. Put
something like this in it:

/var/web2py/

wsgihandler


In this file "pythonpath" is where your web2py directory is and
"script" is the file you want to run, in this case its web2py's
"wsgihandler.py". Now run uWSGI like this, but replace "www-data" with
the owner of your web2py directory, if its the same as your current
user omit the sudo command:
sudo -u www-data uwsgi26 -s /tmp/uwsgi.sock -C -x config.xml
Why you need to change user is because web2py writes things (session
data for example) to disc during execution, so the uwsgi process,
which runs the web2py code, has to be the owner of the directories
that contain the framework. Note that uwsgi now opened a socket we
called "/tmp/uwsgi.sock" About other options consult the uwsgi manual
or "uwsgi -h".

5b) You can omit the xml file and pass all the info via command line,
doing that is easy, so consult the uwsgi docs :)


II. Setting up cherokee (0.99.37 in my case).
1. Install it, run cherokee-admin, go to localhost:9090

2. Open "Information Sources" and create a new one with these
parameters:
Nick: web2py
Connection: /tmp/uwsgi.sock
Interpreter: uwsgi26 -s /tmp/uwsgi.sock -C -x /path/to/config.xml
The interpreter line is why it is a good idea to have your web2py
source owned by www-data or the Cherokee server's user - when cherokee
runs it, you can be sure that owners of the sources and process match.
And of  course put the correct path in.

3. Go to "Virtual Servers" and edit the default one, or you can create
a new one, but make sure you give it a domain name to avoid conflict
(not really sure what happens when they conflict).

4. Go to the "Behavior" section and edit the "Default" behavior.

5. Set the "Handler" to uWSGI and on the bottom set the information
source to "web2py"

6. Pick "Hard restart" from the dropdown on the left and click "Save".
TO PREVENT HEADACHE READ THIS: I seem to get inconsistent results with
these restarts, so if you're doing production it seems to me that one
should restart the server manualy (via /etc/init.d/cherokee restart,
that is). Or maybe I should RTFM.

6. Go to localhost and BAM! (or at least I hope its a bam). veeery
easy if all goes smooth.

"But wait, what about url rewriting?" was my thought, and this caused
much confusion, so I'll add a section on that.


III. Doing some redirection (I'll give few examples due to poor
knowledge of regex).
Lets redirect "localhost/" to "/myapp/cntrlr/index"
1. Go back to the "Behavior" section of your server.

2. Add a new rule and set it's type to "Regular Expression" and set
the regular expression to "^/$", this simply matches "localhost/" or
"localhost", nothing more, nothing less.

3. Go to the "Handler" section and set the rule to "Redirect" with
these parameters
Type: Internal
Regular Expression: (yes, blank)
Substitution: /myapp/cntrlr/index
The regular expression is blank because for this scenario we did all
the matching while defining a new behavior, you can combine the two in
creative ways.

That's about all. Your imagination should take care of the rest. I,
for example, put my static files separately from the framework by
creating a behavior that points to "/static" and picking "static
files" as the handler.
Thanks to Massimo DiPierro for web2py and Phyo Arkar for his cherokee
howto.
I'm not much of a writer so feel free to ask for clarifications.
-- 
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.




[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-17 Thread Ivan P
mdipierro:
It works. Running  http://localhost/admin/default/site all the CSS,
images and scripts are loaded fine.


On Jan 17, 11:13 pm, mdipierro  wrote:
> Have you tried if web2py file streaming works with cherokee?
>
> On Jan 14, 4:14 pm, Ivan P  wrote:
>
> > Inspired by Phyo Arkar's howto on setting up web2py with Cherokee and
> > FCGI I tried the setup, but was somewhat unsatisfied with the fcgi
> > method and decided to try uWSGI. I am happy I did so, since it proved
> > to be real easy and uWSGI is a real powerhouse and deserves attention
> > of the whole python webdev community. On to the howto.
>
> > I. Compile from source and run the latest uWSGI, 0.9.3 in my case
> > (available herehttp://projects.unbit.it/uwsgi/wiki).
> > 1. Download the source from and unzip.
>
> > 2. To compile you must install packages python-dev and libxml2-dev (at
> > least thats what they are called on a debian-based system)
>
> > 3. When compiling simply run pick a makefile which matches your OS and
> > python version and run something like "make -f Makefile.Linux.Py26".
> > This produces only one executable named uwsgi26, where 26 is my python
> > version. You can put it in /usr/local/bin.
>
> > 5. To run it, you have two options:
>
> > 5a) Create an xml file and call it, for example, config.xml. Put
> > something like this in it:
> > 
> >     /var/web2py/
> >     
> >     wsgihandler
> >     
> > 
> > In this file "pythonpath" is where your web2py directory is and
> > "script" is the file you want to run, in this case its web2py's
> > "wsgihandler.py". Now run uWSGI like this, but replace "www-data" with
> > the owner of your web2py directory, if its the same as your current
> > user omit the sudo command:
> > sudo -u www-data uwsgi26 -s /tmp/uwsgi.sock -C -x config.xml
> > Why you need to change user is because web2py writes things (session
> > data for example) to disc during execution, so the uwsgi process,
> > which runs the web2py code, has to be the owner of the directories
> > that contain the framework. Note that uwsgi now opened a socket we
> > called "/tmp/uwsgi.sock" About other options consult the uwsgi manual
> > or "uwsgi -h".
>
> > 5b) You can omit the xml file and pass all the info via command line,
> > doing that is easy, so consult the uwsgi docs :)
>
> > II. Setting up cherokee (0.99.37 in my case).
> > 1. Install it, run cherokee-admin, go to localhost:9090
>
> > 2. Open "Information Sources" and create a new one with these
> > parameters:
> > Nick: web2py
> > Connection: /tmp/uwsgi.sock
> > Interpreter: uwsgi26 -s /tmp/uwsgi.sock -C -x /path/to/config.xml
> > The interpreter line is why it is a good idea to have your web2py
> > source owned by www-data or the Cherokee server's user - when cherokee
> > runs it, you can be sure that owners of the sources and process match.
> > And of  course put the correct path in.
>
> > 3. Go to "Virtual Servers" and edit the default one, or you can create
> > a new one, but make sure you give it a domain name to avoid conflict
> > (not really sure what happens when they conflict).
>
> > 4. Go to the "Behavior" section and edit the "Default" behavior.
>
> > 5. Set the "Handler" to uWSGI and on the bottom set the information
> > source to "web2py"
>
> > 6. Pick "Hard restart" from the dropdown on the left and click "Save".
> > TO PREVENT HEADACHE READ THIS: I seem to get inconsistent results with
> > these restarts, so if you're doing production it seems to me that one
> > should restart the server manualy (via /etc/init.d/cherokee restart,
> > that is). Or maybe I should RTFM.
>
> > 6. Go to localhost and BAM! (or at least I hope its a bam). veeery
> > easy if all goes smooth.
>
> > "But wait, what about url rewriting?" was my thought, and this caused
> > much confusion, so I'll add a section on that.
>
> > III. Doing some redirection (I'll give few examples due to poor
> > knowledge of regex).
> > Lets redirect "localhost/" to "/myapp/cntrlr/index"
> > 1. Go back to the "Behavior" section of your server.
>
> > 2. Add a new rule and set it's type to "Regular Expression" and set
> > the regular expression to "^/$", this simply matches "localhost/" or
> > "localhost", nothing more, nothing less.
>
> > 3. Go to the "Han

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-17 Thread Ivan P
Alex,
Actually, this is my first try at a production deployment, and I have
not set up another to test against. Is there a standard "ab" test that
is usually run for comparison in web2py community? In any case I ran
the following command with sqlite as the backend server (but doubt it
matters for this page) for the cherokee setup and the web2py builtin:
ab -n 1000 -c 5 url

===CHEROKEE results===

Server Software:Cherokee/0.99.39
Server Hostname:cparts.localhost
Server Port:80

Document Path:  /admin/default/index
Document Length:5658 bytes

Concurrency Level:  5
Time taken for tests:   41.809 seconds
Complete requests:  1000
Failed requests:0
Write errors:   0
Total transferred:  6031000 bytes
HTML transferred:   5658000 bytes
Requests per second:23.92 [#/sec] (mean)
Time per request:   209.043 [ms] (mean)
Time per request:   41.809 [ms] (mean, across all concurrent
requests)
Transfer rate:  140.87 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.1  0   3
Processing:65  208  11.3208 283
Waiting:   65  208  11.3208 283
Total: 69  209  11.2208 283

Percentage of the requests served within a certain time (ms)
  50%208
  66%212
  75%214
  80%215
  90%219
  95%223
  98%235
  99%245
 100%283 (longest request)


===CHERRY PY results===

Server Software:CherryPy/3.2.0beta
Server Hostname:localhost
Server Port:8000

Document Path:  /welcome/default/index
Document Length:6531 bytes

Concurrency Level:  5
Time taken for tests:   41.120 seconds
Complete requests:  1000
Failed requests:0
Write errors:   0
Total transferred:  6892000 bytes
HTML transferred:   6531000 bytes
Requests per second:24.32 [#/sec] (mean)
Time per request:   205.601 [ms] (mean)
Time per request:   41.120 [ms] (mean, across all concurrent
requests)
Transfer rate:  163.68 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.0  0   0
Processing:51  205  66.0197 499
Waiting:   50  201  65.2193 499
Total: 52  205  66.0197 499

Percentage of the requests served within a certain time (ms)
  50%197
  66%222
  75%240
  80%254
  90%296
  95%328
  98%368
  99%402
 100%499 (longest request)

Sure, I'll make it a slice.

On Jan 17, 11:01 pm, Alex Fanjul  wrote:
> Many thanks for your tutorial Ivan,
> I'll give it a try... have you noticed any improvements with cherokee?
> could you show us your "ab" benchmarks?
>
> regards,
> Alex F
>
> P.S: try to make an slice in web2pyslices.com
>
> El 14/01/2010 23:14, Ivan P escribi :
>
>
>
> > Inspired by Phyo Arkar's howto on setting up web2py with Cherokee and
> > FCGI I tried the setup, but was somewhat unsatisfied with the fcgi
> > method and decided to try uWSGI. I am happy I did so, since it proved
> > to be real easy and uWSGI is a real powerhouse and deserves attention
> > of the whole python webdev community. On to the howto.
>
> > I. Compile from source and run the latest uWSGI, 0.9.3 in my case
> > (available herehttp://projects.unbit.it/uwsgi/wiki).
> > 1. Download the source from and unzip.
>
> > 2. To compile you must install packages python-dev and libxml2-dev (at
> > least thats what they are called on a debian-based system)
>
> > 3. When compiling simply run pick a makefile which matches your OS and
> > python version and run something like "make -f Makefile.Linux.Py26".
> > This produces only one executable named uwsgi26, where 26 is my python
> > version. You can put it in /usr/local/bin.
>
> > 5. To run it, you have two options:
>
> > 5a) Create an xml file and call it, for example, config.xml. Put
> > something like this in it:
> > 
> >      /var/web2py/
> >      
> >      wsgihandler
> >      
> > 
> > In this file "pythonpath" is where your web2py directory is and
> > "script" is the file you want to run, in this case its web2py's
> > "wsgihandler.py". Now run uWSGI like this, but replace "www-data" with
> > the owner of your web2py directory, if its the same as your current
> > user omit the sudo command:
> > sudo -u www-data uwsgi26 -s /tmp/uwsgi.sock -C -x config.xml
> > Why you need to change user is because web2py writes things (session
> > data for example) to disc during execution, so the uwsgi process,
> > which runs the web2py code, has to be the owner of the directories
&

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-18 Thread Ivan P
Hmmm, you are right. But, since I was loading the index page of the
standard admin interface, that I have not compiled, I guess it is
whatever the admin defaults are (does admin even use a db?). Right?

On Jan 18, 12:15 am, mdipierro  wrote:
> In your benchmark, did you set migrate=False and bytecode compile the
> app? Did you use Auth? How many additional tables?
>
> On Jan 17, 3:11 pm, mdipierro  wrote:
>
> > These tests basically measure lots of things at once and are dominated
> > by the database. If your are using sqlite, it locks the database
> > completely on every request so there is no concurrency.
>
> > I think we need a standard app for testing with various options:
>
> > 1) db, no-db
> > 2) 1,10,100 tables
> > 3) view, no-view
> > 4) compiled, not-compiler
>
> > On Jan 17, 2:49 pm, Ivan P  wrote:
>
> > > Alex,
> > > Actually, this is my first try at a production deployment, and I have
> > > not set up another to test against. Is there a standard "ab" test that
> > > is usually run for comparison in web2py community? In any case I ran
> > > the following command with sqlite as the backend server (but doubt it
> > > matters for this page) for the cherokee setup and the web2py builtin:
> > > ab -n 1000 -c 5 url
>
> > > ===CHEROKEE results===
>
> > > Server Software:        Cherokee/0.99.39
> > > Server Hostname:        cparts.localhost
> > > Server Port:            80
>
> > > Document Path:          /admin/default/index
> > > Document Length:        5658 bytes
>
> > > Concurrency Level:      5
> > > Time taken for tests:   41.809 seconds
> > > Complete requests:      1000
> > > Failed requests:        0
> > > Write errors:           0
> > > Total transferred:      6031000 bytes
> > > HTML transferred:       5658000 bytes
> > > Requests per second:    23.92 [#/sec] (mean)
> > > Time per request:       209.043 [ms] (mean)
> > > Time per request:       41.809 [ms] (mean, across all concurrent
> > > requests)
> > > Transfer rate:          140.87 [Kbytes/sec] received
>
> > > Connection Times (ms)
> > >               min  mean[+/-sd] median   max
> > > Connect:        0    0   0.1      0       3
> > > Processing:    65  208  11.3    208     283
> > > Waiting:       65  208  11.3    208     283
> > > Total:         69  209  11.2    208     283
>
> > > Percentage of the requests served within a certain time (ms)
> > >   50%    208
> > >   66%    212
> > >   75%    214
> > >   80%    215
> > >   90%    219
> > >   95%    223
> > >   98%    235
> > >   99%    245
> > >  100%    283 (longest request)
>
> > > ===CHERRY PY results===
>
> > > Server Software:        CherryPy/3.2.0beta
> > > Server Hostname:        localhost
> > > Server Port:            8000
>
> > > Document Path:          /welcome/default/index
> > > Document Length:        6531 bytes
>
> > > Concurrency Level:      5
> > > Time taken for tests:   41.120 seconds
> > > Complete requests:      1000
> > > Failed requests:        0
> > > Write errors:           0
> > > Total transferred:      6892000 bytes
> > > HTML transferred:       6531000 bytes
> > > Requests per second:    24.32 [#/sec] (mean)
> > > Time per request:       205.601 [ms] (mean)
> > > Time per request:       41.120 [ms] (mean, across all concurrent
> > > requests)
> > > Transfer rate:          163.68 [Kbytes/sec] received
>
> > > Connection Times (ms)
> > >               min  mean[+/-sd] median   max
> > > Connect:        0    0   0.0      0       0
> > > Processing:    51  205  66.0    197     499
> > > Waiting:       50  201  65.2    193     499
> > > Total:         52  205  66.0    197     499
>
> > > Percentage of the requests served within a certain time (ms)
> > >   50%    197
> > >   66%    222
> > >   75%    240
> > >   80%    254
> > >   90%    296
> > >   95%    328
> > >   98%    368
> > >   99%    402
> > >  100%    499 (longest request)
>
> > > Sure, I'll make it a slice.
>
> > > On Jan 17, 11:01 pm, Alex Fanjul  wrote:
>
> > > > Many thanks for your tutorial Ivan,
> > > > I'll give it a try... have you noticed any improvements with cherokee?
> > > > could you show us your "ab" benchmarks

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-18 Thread Ivan P
OK, I had some flaws in the last test that, I have realized, were
affecting the performance. For example uwsgi was outputing a whole lot
of data into gnome-terminal, which used much CPU. The new benchmark
with uwsgi running as a daemon:

Concurrency Level:  5
Time taken for tests:   22.585 seconds
Complete requests:  1000
Failed requests:0
Write errors:   0
Total transferred:  6906000 bytes
HTML transferred:   6531000 bytes
Requests per second:44.28 [#/sec] (mean)
Time per request:   112.923 [ms] (mean)
Time per request:   22.585 [ms] (mean, across all concurrent
requests)
Transfer rate:  298.62 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.0  0   0
Processing:65  113   6.2111 164
Waiting:   65  112   6.2111 164
Total: 66  113   6.2111 164

Percentage of the requests served within a certain time (ms)
  50%111
  66%112
  75%113
  80%115
  90%119
  95%125
  98%133
  99%138
 100%164 (longest request)

ALSO, I tried running uwsgi with 4 worker processes by adding the
option "-p 4":

Concurrency Level:  5
Time taken for tests:   14.575 seconds
Complete requests:  1000
Failed requests:0
Write errors:   0
Total transferred:  6906000 bytes
HTML transferred:   6531000 bytes
Requests per second:68.61 [#/sec] (mean)
Time per request:   72.876 [ms] (mean)
Time per request:   14.575 [ms] (mean, across all concurrent
requests)
Transfer rate:  462.71 [Kbytes/sec] received

On Jan 18, 6:20 pm, mdipierro  wrote:
> You are right, the admin interface does not do db IO. From your test
> it is slow. Not sure why that is.
>
> On Jan 18, 2:14 am, Ivan P  wrote:
>
> > Hmmm, you are right. But, since I was loading the index page of the
> > standard admin interface, that I have not compiled, I guess it is
> > whatever the admin defaults are (does admin even use a db?). Right?
>
> > On Jan 18, 12:15 am, mdipierro  wrote:
>
> > > In your benchmark, did you set migrate=False and bytecode compile the
> > > app? Did you use Auth? How many additional tables?
>
> > > On Jan 17, 3:11 pm, mdipierro  wrote:
>
> > > > These tests basically measure lots of things at once and are dominated
> > > > by the database. If your are using sqlite, it locks the database
> > > > completely on every request so there is no concurrency.
>
> > > > I think we need a standard app for testing with various options:
>
> > > > 1) db, no-db
> > > > 2) 1,10,100 tables
> > > > 3) view, no-view
> > > > 4) compiled, not-compiler
>
> > > > On Jan 17, 2:49 pm, Ivan P  wrote:
>
> > > > > Alex,
> > > > > Actually, this is my first try at a production deployment, and I have
> > > > > not set up another to test against. Is there a standard "ab" test that
> > > > > is usually run for comparison in web2py community? In any case I ran
> > > > > the following command with sqlite as the backend server (but doubt it
> > > > > matters for this page) for the cherokee setup and the web2py builtin:
> > > > > ab -n 1000 -c 5 url
>
> > > > > ===CHEROKEE results===
>
> > > > > Server Software:        Cherokee/0.99.39
> > > > > Server Hostname:        cparts.localhost
> > > > > Server Port:            80
>
> > > > > Document Path:          /admin/default/index
> > > > > Document Length:        5658 bytes
>
> > > > > Concurrency Level:      5
> > > > > Time taken for tests:   41.809 seconds
> > > > > Complete requests:      1000
> > > > > Failed requests:        0
> > > > > Write errors:           0
> > > > > Total transferred:      6031000 bytes
> > > > > HTML transferred:       5658000 bytes
> > > > > Requests per second:    23.92 [#/sec] (mean)
> > > > > Time per request:       209.043 [ms] (mean)
> > > > > Time per request:       41.809 [ms] (mean, across all concurrent
> > > > > requests)
> > > > > Transfer rate:          140.87 [Kbytes/sec] received
>
> > > > > Connection Times (ms)
> > > > >               min  mean[+/-sd] median   max
> > > > > Connect:        0    0   0.1      0       3
> > > > > Processing:    65  208  11.3    208     283
> > > > > Waiting:       65  208  11.3    208     283
> > > > > Total:         69  209  11.2    208 

[web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-01-18 Thread Ivan P
No this is not bytecode compiled. What is odd is that I thought I
compiled admin yesterday to get great performance improvement, but now
compiling is not making a difference. I'm somewhat confused. So, I
cannot give much more data on this topic at the moment.
Why I chose Cherokee in the first place, though, was for the reported
ease of setup, since I have much work and little time. I think in that
domain it and uWSGI succeed. The setup was painless, it is flexible,
easy to tweak, uses next to no memory and seems reliable.

On Jan 18, 7:30 pm, mdipierro  wrote:
> This more like what I would expect. Is this bytecode compiled? It
> makes a difference.
>
> On Jan 18, 10:15 am, Ivan P  wrote:
>
> > OK, I had some flaws in the last test that, I have realized, were
> > affecting the performance. For example uwsgi was outputing a whole lot
> > of data into gnome-terminal, which used much CPU. The new benchmark
> > with uwsgi running as a daemon:
>
> > Concurrency Level:      5
> > Time taken for tests:   22.585 seconds
> > Complete requests:      1000
> > Failed requests:        0
> > Write errors:           0
> > Total transferred:      6906000 bytes
> > HTML transferred:       6531000 bytes
> > Requests per second:    44.28 [#/sec] (mean)
> > Time per request:       112.923 [ms] (mean)
> > Time per request:       22.585 [ms] (mean, across all concurrent
> > requests)
> > Transfer rate:          298.62 [Kbytes/sec] received
>
> > Connection Times (ms)
> >               min  mean[+/-sd] median   max
> > Connect:        0    0   0.0      0       0
> > Processing:    65  113   6.2    111     164
> > Waiting:       65  112   6.2    111     164
> > Total:         66  113   6.2    111     164
>
> > Percentage of the requests served within a certain time (ms)
> >   50%    111
> >   66%    112
> >   75%    113
> >   80%    115
> >   90%    119
> >   95%    125
> >   98%    133
> >   99%    138
> >  100%    164 (longest request)
>
> > ALSO, I tried running uwsgi with 4 worker processes by adding the
> > option "-p 4":
>
> > Concurrency Level:      5
> > Time taken for tests:   14.575 seconds
> > Complete requests:      1000
> > Failed requests:        0
> > Write errors:           0
> > Total transferred:      6906000 bytes
> > HTML transferred:       6531000 bytes
> > Requests per second:    68.61 [#/sec] (mean)
> > Time per request:       72.876 [ms] (mean)
> > Time per request:       14.575 [ms] (mean, across all concurrent
> > requests)
> > Transfer rate:          462.71 [Kbytes/sec] received
>
> > On Jan 18, 6:20 pm, mdipierro  wrote:
>
> > > You are right, the admin interface does not do db IO. From your test
> > > it is slow. Not sure why that is.
>
> > > On Jan 18, 2:14 am, Ivan P  wrote:
>
> > > > Hmmm, you are right. But, since I was loading the index page of the
> > > > standard admin interface, that I have not compiled, I guess it is
> > > > whatever the admin defaults are (does admin even use a db?). Right?
>
> > > > On Jan 18, 12:15 am, mdipierro  wrote:
>
> > > > > In your benchmark, did you set migrate=False and bytecode compile the
> > > > > app? Did you use Auth? How many additional tables?
>
> > > > > On Jan 17, 3:11 pm, mdipierro  wrote:
>
> > > > > > These tests basically measure lots of things at once and are 
> > > > > > dominated
> > > > > > by the database. If your are using sqlite, it locks the database
> > > > > > completely on every request so there is no concurrency.
>
> > > > > > I think we need a standard app for testing with various options:
>
> > > > > > 1) db, no-db
> > > > > > 2) 1,10,100 tables
> > > > > > 3) view, no-view
> > > > > > 4) compiled, not-compiler
>
> > > > > > On Jan 17, 2:49 pm, Ivan P  wrote:
>
> > > > > > > Alex,
> > > > > > > Actually, this is my first try at a production deployment, and I 
> > > > > > > have
> > > > > > > not set up another to test against. Is there a standard "ab" test 
> > > > > > > that
> > > > > > > is usually run for comparison in web2py community? In any case I 
> > > > > > > ran
> > > > > > > the following command with sqlite as the backend server (but 
> > > > > > > doubt it
> > 

[web2py] Auth default controller annoyance

2010-01-19 Thread Ivan P
This is fairly minor problem, but seems to go against the web2py
philosophy as I see it. If after initializing the Auth object you
would like to change the default controller, you must redefine a bunch
of variables:
self.settings.login_url,
self.settings.logged_url,
self.settings.download_url,
etc.
That is because they are define at the initialization, and altering
self.settings.controller afterwards does not solve the problem. It
seems to me most people would outright redefine a few of those
variables, for example login_next by default points to yourapp/default/
index, and few would ever use that as the default. How about something
like:
class Auth(object):
def __init__(self, environment, db=None, controller='default'):
self.settings.controller=controller

Or maybe I'm confused? :)


-- 
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.




[web2py] Re: Newbie Question: Intellisense for Web2Py?

2010-01-20 Thread Ivan P
While completion is nice, I think that what seems like a steep
learning curve is actually not that much. You mostly use a few of the
framework functions and variables, unless you adding something new to
your project, like authentication or maybe a new table. So I'd say
that you don't need it. And if using a framework like this is a bit
too much at first, try some offline project with smaller libraries.
I'm sure you could come up with some fun little scripts to write, with
PyGame for example.
In general I'd say that while completion in python speeds things up
(ipython is a really pleasant tool for that reason), it is of much
less use than in Java for example, with which I've worked quite a bit
(oh the years of sorrow!).

On Jan 20, 9:24 am, Tweety  wrote:
> Hello,
>
> I am a newbie both with web2py, python and computer and web development
> in general. I am trying to digest Massimo's book which I bought from
> Lulu. I just want to ask anybody if they can suggest an IDE that has
> intellisense that can make learning much more easier for me?
>
> Right now, I am just trying to memorize all the functions and it is
> really hard for me :(
>
> I am desperate to learn but am wondering if anybody can suggest an IDE
> that can work with web2py that has intellisense?
>
> I hope someday Web2Py will have intellisense :)
>
> Thanks 2 you all,
>
> Tweety
-- 
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.




[web2py] "duplicate column name" error

2010-01-20 Thread Ivan P
I am encountering a strange error, and was wondering if anybody else
has seen something like it.
The code:
auth.settings.table_user = db.define_table(
auth.settings.table_user_name,
Field('username', length=32, notnull=True, unique=True,
 requires = [IS_LENGTH(minsize=3), IS_NOT_IN_DB
(db,auth.settings.table_user_name+'.username')]),
Field('first_name', length=128,default=''),
Field('last_name', length=128,default=''),
Field('email', length=128,default='',
 requires = [IS_EMAIL()]),
Field('firm_name', length=128),
Field('address', length=256),
Field('firm_type', length=128),
Field('contact_name', length=128),
Field('phone', length=32),
Field('discount', 'double', default=0, requires=[IS_FLOAT_IN_RANGE
(0,1)]),
Field('password', 'password', readable=False,
 label='Password', requires=CRYPT()),
Field('registration_key', length=128,
 writable=False, readable=False,default=''))

The traceback:
Traceback (most recent call last):
  File "/home/anyapan/work/web2py/gluon/restricted.py", line 173, in
restricted
exec ccode in environment
  File "/home/anyapan/work/web2py/applications/cparts/models/db.py",
line 49, in 
writable=False, readable=False,default=''))
  File "/home/anyapan/work/web2py/gluon/sql.py", line 1252, in
define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
  File "/home/anyapan/work/web2py/gluon/sql.py", line 1709, in _create
fake_migrate=fake_migrate)
  File "/home/anyapan/work/web2py/gluon/sql.py", line 1763, in
_migrate
self._db._execute(sub_query)
  File "/home/anyapan/work/web2py/gluon/sql.py", line 890, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
OperationalError: duplicate column name: phone

When I remove the "Field('phone'..." entry everything works fine. As
you see there is no other column with that name.
Thanks!
-- 
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.




[web2py] Re: "duplicate column name" error

2010-01-20 Thread Ivan P
Mkay, I dropped the table and deleted the ".table" file for it and all
is well. I should have looked the at the table structure before that,
silly me. I suspect that the column was already added before, but
web2py did not register the fact and was trying to add a new one with
the same name.

On Jan 20, 3:03 pm, Ivan P  wrote:
> I am encountering a strange error, and was wondering if anybody else
> has seen something like it.
> The code:
> auth.settings.table_user = db.define_table(
>     auth.settings.table_user_name,
>     Field('username', length=32, notnull=True, unique=True,
>              requires = [IS_LENGTH(minsize=3), IS_NOT_IN_DB
> (db,auth.settings.table_user_name+'.username')]),
>     Field('first_name', length=128,default=''),
>     Field('last_name', length=128,default=''),
>     Field('email', length=128,default='',
>              requires = [IS_EMAIL()]),
>     Field('firm_name', length=128),
>     Field('address', length=256),
>     Field('firm_type', length=128),
>     Field('contact_name', length=128),
>     Field('phone', length=32),
>     Field('discount', 'double', default=0, requires=[IS_FLOAT_IN_RANGE
> (0,1)]),
>     Field('password', 'password', readable=False,
>              label='Password', requires=CRYPT()),
>     Field('registration_key', length=128,
>              writable=False, readable=False,default=''))
>
> The traceback:
> Traceback (most recent call last):
>   File "/home/anyapan/work/web2py/gluon/restricted.py", line 173, in
> restricted
>     exec ccode in environment
>   File "/home/anyapan/work/web2py/applications/cparts/models/db.py",
> line 49, in 
>     writable=False, readable=False,default=''))
>   File "/home/anyapan/work/web2py/gluon/sql.py", line 1252, in
> define_table
>     t._create(migrate=migrate, fake_migrate=fake_migrate)
>   File "/home/anyapan/work/web2py/gluon/sql.py", line 1709, in _create
>     fake_migrate=fake_migrate)
>   File "/home/anyapan/work/web2py/gluon/sql.py", line 1763, in
> _migrate
>     self._db._execute(sub_query)
>   File "/home/anyapan/work/web2py/gluon/sql.py", line 890, in 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> OperationalError: duplicate column name: phone
>
> When I remove the "Field('phone'..." entry everything works fine. As
> you see there is no other column with that name.
> Thanks!
-- 
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.




[web2py] Re: Cherokee problem

2010-01-21 Thread Ivan P
Johann, mdipierro is correct in saying that setting up web2py with
cherokee, for example, is no different than setting up any other
framework, there are not many options for framework-server
integration. A couple of weeks ago I was also very frustrated with
setting up a production server, but was able to find an easy way,
which I documented in a howto. Google "web2py uwsgi" and the first
link is my howto, or just browse this group. I hope it helps.

On Jan 20, 6:43 pm, Johann Spies  wrote:
> As I am unable to get a solution to my problems serving web2py using
> apache alongside other sites I am trying out Cherokee - so far with no
> success.  I have followed the instructions in the book but this
> results in
>
> 404 Not Found
> The requested URL /welcome/default/index was not found on this server.
>
> Cherokee web server 0.99.38 (Debian GNU/Linux), Port 80
>
> In /var/log/cherokee/cherokee.error:
>
> [20/01/2010 17:34:23.171] (error) fdpoll-epoll.c:140 - epoll_ctl:
> ep_fd 13, fd 3: 'Bad file descriptor'
>
> and in /var/log/cherokee.access:
>
> ::1 - - [20/Jan/2010:17:38:13 +0200] "GET /welcome/default/index
> HTTP/1.1" 404 0 "-" "Mozilla/5.0 (X11; U; Linux x86_64; af;
> rv:1.9.1.6) Gecko/20091216 Iceweasel/3.5.6 (like Firefox/3.5.6;
> Debian-3.5.6-1)"
>
> My config file looks like this:
>
> config!version = 99038
> server!bind!1!port = 80
> server!bind!1!tls = 0
> server!group = www-data
> server!ipv6 = 1
> server!keepalive = 1
> server!keepalive_max_requests = 500
> server!panic_action = /usr/share/cherokee/cherokee-panic
> server!pid_file = /var/run/cherokee.pid
> server!server_tokens = full
> server!timeout = 15
> server!user = www-data
> vserver!10!directory_index = index.html
> vserver!10!document_root = /var/www
> vserver!10!error_writer!filename = /var/log/cherokee/cherokee.error
> vserver!10!error_writer!type = file
> vserver!10!logger = combined
> vserver!10!logger!access!buffsize = 16384
> vserver!10!logger!access!filename = /var/log/cherokee/cherokee.access
> vserver!10!logger!access!type = file
> vserver!10!nick = default
> vserver!10!rule!500!encoder!gzip = 1
> vserver!10!rule!500!handler = server_info
> vserver!10!rule!500!handler!type = just_about
> vserver!10!rule!500!match = directory
> vserver!10!rule!500!match!directory = /about
> vserver!10!rule!400!document_root = /usr/lib/cgi-bin
> vserver!10!rule!400!handler = cgi
> vserver!10!rule!400!match = directory
> vserver!10!rule!400!match!directory = /cgi-bin
> vserver!10!rule!300!document_root = /usr/share/cherokee/themes
> vserver!10!rule!300!handler = file
> vserver!10!rule!300!match = directory
> vserver!10!rule!300!match!directory = /cherokee_themes
> vserver!10!rule!200!document_root = /usr/share/cherokee/icons
> vserver!10!rule!200!handler = file
> vserver!10!rule!200!match = directory
> vserver!10!rule!200!match!directory = /icons
> vserver!10!rule!100!encoder!deflate = 0
> vserver!10!rule!100!encoder!gzip = 0
> vserver!10!rule!100!handler = fcgi
> vserver!10!rule!100!handler!balancer = round_robin
> vserver!10!rule!100!handler!balancer!source!1 = 1
> vserver!10!rule!100!handler!change_user = 0
> vserver!10!rule!100!handler!check_file = 1
> vserver!10!rule!100!handler!error_handler = 1
> vserver!10!rule!100!handler!pass_req_headers = 1
> vserver!10!rule!100!handler!x_real_ip_access_all = 1
> vserver!10!rule!100!handler!x_real_ip_enabled = 1
> vserver!10!rule!100!handler!xsendfile = 0
> vserver!10!rule!100!match = default
> vserver!10!rule!100!no_log = 0
> vserver!10!rule!100!only_secure = 0
> source!1!env_inherited = 1
> source!1!host = /tmp/fcgi.sock
> source!1!interpreter = /var/www/web2py/startweb2py.sh
> source!1!nick = web2py
> source!1!type = interpreter
> icons!default = page_white.png
> icons!directory = folder.png
> icons!file!bomb.png = core
> icons!file!page_white_go.png = *README*
> icons!parent_directory = arrow_turn_left.png
> icons!suffix!camera.png = jpg,jpeg,jpe
> icons!suffix!cd.png = iso,ngr,cue
> icons!suffix!color_wheel.png = png,gif,xcf,bmp,pcx,tiff,tif,cdr,psd,xpm,xbm
> icons!suffix!control_play.png = bin,exe,com,msi,out
> icons!suffix!css.png = css
> icons!suffix!cup.png = java,class,jar
> icons!suffix!email.png = eml,mbox,box,email,mbx
> icons!suffix!film.png = avi,mpeg,mpe,mpg,mpeg3,dl,fli,qt,mov,movie,flv
> icons!suffix!font.png = ttf
> icons!suffix!html.png = html,htm
> icons!suffix!music.png =
> au,snd,mid,midi,kar,mpga,mpega,mp2,mp3,sid,wav,aif,aiff,aifc,gsm,m3u,wma,wax,ra,rm,ram,pls,sd2,ogg
> icons!suffix!package.png = tar,gz,bz2,zip,rar,ace,lha,Z,7z
> icons!suffix!page_white_acrobat.png = pdf
> icons!suffix!page_white_c.png = c,h,cpp
> icons!suffix!page_white_office.png = doc,ppt,xls
> icons!suffix!page_white_php.png = php
> icons!suffix!page_white_text.png = txt,text,rtf,sdw
> icons!suffix!printer.png = ps,eps
> icons!suffix!ruby.png = rb
> icons!suffix!script.png = sh,csh,ksh,tcl,tk,py,pl
>
> I have left out the mime/... lines.
>
> I am beginning to doubt the wisdom of my decision to invest a lo

[web2py] Re: Cherokee problem

2010-01-21 Thread Ivan P
Although, I take my words back. My way is not the simplest. =) But it
is not hard at all and is powerful.

On Jan 20, 6:43 pm, Johann Spies  wrote:
> As I am unable to get a solution to my problems serving web2py using
> apache alongside other sites I am trying out Cherokee - so far with no
> success.  I have followed the instructions in the book but this
> results in
>
> 404 Not Found
> The requested URL /welcome/default/index was not found on this server.
>
> Cherokee web server 0.99.38 (Debian GNU/Linux), Port 80
>
> In /var/log/cherokee/cherokee.error:
>
> [20/01/2010 17:34:23.171] (error) fdpoll-epoll.c:140 - epoll_ctl:
> ep_fd 13, fd 3: 'Bad file descriptor'
>
> and in /var/log/cherokee.access:
>
> ::1 - - [20/Jan/2010:17:38:13 +0200] "GET /welcome/default/index
> HTTP/1.1" 404 0 "-" "Mozilla/5.0 (X11; U; Linux x86_64; af;
> rv:1.9.1.6) Gecko/20091216 Iceweasel/3.5.6 (like Firefox/3.5.6;
> Debian-3.5.6-1)"
>
> My config file looks like this:
>
> config!version = 99038
> server!bind!1!port = 80
> server!bind!1!tls = 0
> server!group = www-data
> server!ipv6 = 1
> server!keepalive = 1
> server!keepalive_max_requests = 500
> server!panic_action = /usr/share/cherokee/cherokee-panic
> server!pid_file = /var/run/cherokee.pid
> server!server_tokens = full
> server!timeout = 15
> server!user = www-data
> vserver!10!directory_index = index.html
> vserver!10!document_root = /var/www
> vserver!10!error_writer!filename = /var/log/cherokee/cherokee.error
> vserver!10!error_writer!type = file
> vserver!10!logger = combined
> vserver!10!logger!access!buffsize = 16384
> vserver!10!logger!access!filename = /var/log/cherokee/cherokee.access
> vserver!10!logger!access!type = file
> vserver!10!nick = default
> vserver!10!rule!500!encoder!gzip = 1
> vserver!10!rule!500!handler = server_info
> vserver!10!rule!500!handler!type = just_about
> vserver!10!rule!500!match = directory
> vserver!10!rule!500!match!directory = /about
> vserver!10!rule!400!document_root = /usr/lib/cgi-bin
> vserver!10!rule!400!handler = cgi
> vserver!10!rule!400!match = directory
> vserver!10!rule!400!match!directory = /cgi-bin
> vserver!10!rule!300!document_root = /usr/share/cherokee/themes
> vserver!10!rule!300!handler = file
> vserver!10!rule!300!match = directory
> vserver!10!rule!300!match!directory = /cherokee_themes
> vserver!10!rule!200!document_root = /usr/share/cherokee/icons
> vserver!10!rule!200!handler = file
> vserver!10!rule!200!match = directory
> vserver!10!rule!200!match!directory = /icons
> vserver!10!rule!100!encoder!deflate = 0
> vserver!10!rule!100!encoder!gzip = 0
> vserver!10!rule!100!handler = fcgi
> vserver!10!rule!100!handler!balancer = round_robin
> vserver!10!rule!100!handler!balancer!source!1 = 1
> vserver!10!rule!100!handler!change_user = 0
> vserver!10!rule!100!handler!check_file = 1
> vserver!10!rule!100!handler!error_handler = 1
> vserver!10!rule!100!handler!pass_req_headers = 1
> vserver!10!rule!100!handler!x_real_ip_access_all = 1
> vserver!10!rule!100!handler!x_real_ip_enabled = 1
> vserver!10!rule!100!handler!xsendfile = 0
> vserver!10!rule!100!match = default
> vserver!10!rule!100!no_log = 0
> vserver!10!rule!100!only_secure = 0
> source!1!env_inherited = 1
> source!1!host = /tmp/fcgi.sock
> source!1!interpreter = /var/www/web2py/startweb2py.sh
> source!1!nick = web2py
> source!1!type = interpreter
> icons!default = page_white.png
> icons!directory = folder.png
> icons!file!bomb.png = core
> icons!file!page_white_go.png = *README*
> icons!parent_directory = arrow_turn_left.png
> icons!suffix!camera.png = jpg,jpeg,jpe
> icons!suffix!cd.png = iso,ngr,cue
> icons!suffix!color_wheel.png = png,gif,xcf,bmp,pcx,tiff,tif,cdr,psd,xpm,xbm
> icons!suffix!control_play.png = bin,exe,com,msi,out
> icons!suffix!css.png = css
> icons!suffix!cup.png = java,class,jar
> icons!suffix!email.png = eml,mbox,box,email,mbx
> icons!suffix!film.png = avi,mpeg,mpe,mpg,mpeg3,dl,fli,qt,mov,movie,flv
> icons!suffix!font.png = ttf
> icons!suffix!html.png = html,htm
> icons!suffix!music.png =
> au,snd,mid,midi,kar,mpga,mpega,mp2,mp3,sid,wav,aif,aiff,aifc,gsm,m3u,wma,wax,ra,rm,ram,pls,sd2,ogg
> icons!suffix!package.png = tar,gz,bz2,zip,rar,ace,lha,Z,7z
> icons!suffix!page_white_acrobat.png = pdf
> icons!suffix!page_white_c.png = c,h,cpp
> icons!suffix!page_white_office.png = doc,ppt,xls
> icons!suffix!page_white_php.png = php
> icons!suffix!page_white_text.png = txt,text,rtf,sdw
> icons!suffix!printer.png = ps,eps
> icons!suffix!ruby.png = rb
> icons!suffix!script.png = sh,csh,ksh,tcl,tk,py,pl
>
> I have left out the mime/... lines.
>
> I am beginning to doubt the wisdom of my decision to invest a lot of
> time to learn web2py as it seems a quite difficult product to serve in
> a production environment alongside other webpages.
>
> What am I doing wrong?
>
> Regards
> Johann
-- 
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 un