Mailing List Archive

Django and Cherokee again...
Hello all,

I'm continuing to struggle with exposing my Django app through Cherokee. Alvaro suggested I run CHEROKEE_TRACE to investigate the problem, but doing a source build and reading output from that is pretty daunting. And I'm pretty sure this is just a configuration problem.

I have restructured the directories and have gotten closer to getting it working.

I now have a vServer for a NurseTriage directory in the physical file system (/var/www/NurseTriage). There is an index.html file in this directory and it is served normally. Within this vServer, I have a rule with web directory of /triagedb (physical directory is /var/www/NurseTriage/triagedb), and only accepts requests from port 443. This rule's handler is set to SCGI with the usual settings as configured by the Django wizard. It uses an information source called Django 11. This is the interpreter line for that source:

python /var/www/NurseTriage/triagedb/manage.py runfcgi protocol=scgi host=127.0.0.1 port=44945

I'd like to ask some questions before diving into a source build and a trace.

When I browse to https://localhost/NurseTriage, I get the index page just fine. When I browse to https://localhost/NurseTriage/triagedb/admin, I get a 404. So my first question is: am I using the right document roots and urls to browse them? I think I am, but like I said -- no joy.

I notice two other things as well. When I browse to /NurseTriage/triagedb or anything below that, I notice there is no instance of manage.py running anywhere in the system. So my next question is: does Cherokee launch the Django FCGI handler, or do I need to set it up in init.d? I have run the above interpreter line manually, then browsed to /NurseTriage/triagedb, but still no joy. There is something going on here with Django that seems strange to me too, but I'll ask about that on the Django list.

Lastly, I notice every time I hit one of the Django urls, the following error appears in the Cherokee error log:

{'type': "error", 'time': "29/08/2011 01:22:34.324", 'title': "epoll_ctl: ep_fd 19, fd 5: 'Bad file descriptor'", 'code': "fdpoll-epoll.c:140", 'error': "81", 'description': "The issue seems to be related to your system.", 'version': "1.0.14", 'compilation_date': "Dec 13 2010 21:49:35", 'configure_args': " '--host=x86_64-linux-gnu' '--build=x86_64-linux-gnu' '--enable-os-string=Ubuntu' '--enable-pthreads' '--prefix=/usr' '--localstatedir=/var' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--docdir=/usr/share/doc/cherokee-doc' '--with-wwwroot=/var/www' '--with-included-gettext' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-Wall -g -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS=' '--host=x86_64-linux-gnu' '--build=x86_64-linux-gnu' '--enable-os-string=Ubuntu' '--enable-pthreads' '--prefix=/usr' '--localstatedir=/var' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--docdir=/us
r/share/doc/cherokee-doc' '--with-wwwroot=/var/www' '--with-included-gettext' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-Wall -g -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS='", 'backtrace': ""}

This makes me think there could be a permissions problem somewhere. So what should the owner and file permissions for the Django application directory be? I think I should ask this on the Django list as well.

Thanx again,

Brian

_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: Django and Cherokee again... [ In reply to ]
I get the same errors with Tornado too, but not with all URLS. I am
using 64nit Ubuntu 10.04 LTS
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: Django and Cherokee again... [ In reply to ]
Try using uwsgi with cherokee and django. Makes things much easier.

2011/8/31 Voltron <nhytro@googlemail.com>

> I get the same errors with Tornado too, but not with all URLS. I am
> using 64nit Ubuntu 10.04 LTS
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee
>



--
"A arrogância é a arma dos fracos."

===========================
Italo Moreira Campelo Maia
Bacharel em Ciência da Computação - UECE
Desenvolvedor WEB e Desktop (Java, Python, Lua)
Coordenador do Pug-CE
-----------------------------------------------------
http://www.italomaia.com/
http://twitter.com/italomaia/
http://eusouolobomau.blogspot.com/
-----------------------------------------------------
Turtle Linux 9.10 - http://tiny.cc/blogturtle910
Turtle Linux 10.10 - http://bit.ly/cEw4ET
===========================
Django and Cherokee again... [ In reply to ]
Hi all,

Italo Maia has been very helpful. The key pieces seem to be that:

1) You need to do a source build of uwsgi. I had abandoned uwsgi because the PPA is broken on Ubuntu 10.04 LTS.
And 2) you need to set the information source to "Remote Host", not "Local Interpreter", and take charge of starting and respawning the uwsgi process yourself. I've tried every permutation of "Local Interpreter" I can think of, and could never get it to work. Cherokee would not spawn the process and would not connect to a process it hadn't spawned.

Italo has a web page that outlines all of this stuff, but you have to have Google translate it (unless you read Portuguese); it's here: http://dpaste.org/nKfyU/.

Currently I'm trying to get a properly formatted version of the upstart script. With that, I'll have the correct parameters to uwsgi and be able keep it running.

It might be a good idea to translate Italo's page and add it to the Cherokee docs, or add a link to it.

Thanx again Italo and everyone else,

Brian