502 Bad gateway - django/cherrypy HTTP reverse proxy Round Robin on Cherokee
So I install cherokee and included django-cpserver into my django app.
Thereafter, I ran
python manage.py runcpserver daemonize=1 port=3035 pidfile=/var/run/django/cherrypy.pid-1 threads=1 request_queue_size=0
and repeated these commands to spawn 10 processes cherrypy.pid-1, cherrypy.pid-2, etc etc, cherrypy.pid-10.
On my cherokee admin, I then mapped these 10 information sources to my django instance:-
However, after restarting cherokee, it simply gives me a 502 bad gateway error and looking at my cherokee.error log, I see a series of errors that say:-
{'type': "warning", 'time': "20/09/2011 06:39:26.264",
'title': "Taking source='localhost:3042' back on-line",
'code': "balancer_round_robin.c:170",
'error': "63", 'description': "The information source is being disabled.",
'version': "1.2.99", 'compilation_date': "Sep 16 2011 00:35:11",
'configure_args': " '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-static' '--with-wwwroot=/srv/http' '--with-wwwuser=http' '--with-wwwgroup=http' '--with-python=python2' '--enable-os-string=Arch Linux' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu' '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-static' '--with-wwwroot=/srv/http' '--with-wwwuser=http' '--with-wwwgroup=http' '--with-python=python2' '--enable-os-string=Arch Linux' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu'",
'backtrac开发者_如何学Ce': ""}
I am not sure what I did wrong with my configuration. Will be grateful for any pointers leading me towards the right direction to resolve this "502 gateway error" issue.
(I should add that if I use the standard scgi deployment configuration for django on cherokee, everything works just fine. But I would like to figure out how to use cherrypy as a reverse proxy to deploy django on cherokee.)
Problem solved. Specify the internal IP and all is good!
精彩评论