Hi Tamara,

tsnyder wrote:
> I am extremely new to all of this, so if my question is stupid I'm sorry.  I 
> couldn't find the answer after 
> doing some searches.  I suspect that is because the answer is obvious, and I 
> apologize if it is.

No, it's a small hell when you first do that coming form the luxury of a 
PHP module for example :)

> If I run django as fastcgi with apache, then, as I understand it, there is a 
> fastcgi program running 
> continuously, connected to my django site, and apache just forwards the page 
> request to the fastcgi 
> program.

> It looks like *I* have to manually launch this program.  Is that 
> correct?  How do I keep it running - or relaunch it when it goes down?

You could make an angle process looking after it, relaunching when it 
dies. Or you could use something like 'supervise', from the author of qmail.

Basicly, it's like you are running your Apache or MySQL or any daemon: 
you create an init.d script to launch it at boot, and to stop/start it 
afterwards.

>  And does it time out and quit after a  while?  In some testing yesterday 
> on my powerbook, it looked as if the fastcgi program just died a couple of 
> hours after I started it.  I really don't want to have to start fastcgi
> programs manually several times a day.

On my Mac I'm using Apache for some development, and I am not running 
this fastcgi thing. Here is how I setup Apache:

LoadModule fastcgi_module modules/mod_fastcgi.so
AddType fastcgi-script .fcgi

<directory /Users/geert/Dev/fastcgi-bin/>
   Order deny,allow
   Allow from all
</directory>

<VirtualHost 127.0.0.1:80>
   RewriteEngine On
   ServerAdmin [EMAIL PROTECTED]
   ServerName geert.kemuri.loc
   ErrorLog logs/error_log
   CustomLog logs/access_log common
   DocumentRoot "/Users/geert/Dev/geert/htdocs"

   <directory /Users/geert/Dev/geert/htdocs>
     Order deny,allow
     Allow from all
   </directory>

   Alias /media/admin /Users/geert/Dev/geert/media/admin/
   Alias /media/ /Users/geert/Dev/geert/media/

   ScriptAlias / /Users/geert/Dev/geert/fastcgi-bin/gweb.fcgi/

</VirtualHost>

Any rereqest coming to   http://geert.kemuri.loc, will be handled by the 
gweb.fcgi script. Maybe this is slower, but hey.. works just fine :)
This is what it looks like, gweb.fcgi:

#!/usr/local/python/bin/python
import os
import sys
from flup.server.fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler

sys.path.insert(0, '/Users/geert/Dev/geert/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'gweb.settings'

WSGIServer(WSGIHandler()).run()

I'm using my own compiled Python 2.4, as MacOSX's version is to old..
My Django project is called 'gweb' btw..

(I might wiki this on my website, yeah, 
wiki.some-abstract-type-shit.com, but later, beer now..)

> I am looking at using django to create several web applications.  These apps 
> will have a fairly specific audience, and I don't expect more than a few
 > hundred hits a day (maybe up to 1000 or 1500 a day total
> for all apps once all are running).  Can apache 1.3 and fastcgi work as a 
> solution for me?

Yes. I know guys who did some test, and the fastcgi PHP version for 
example only goes slower on higher load. Not significantly but just 
enough to make the module version faster.

Actually.. you don't have much choice using fastcgi. The python module 
is maybe slower? Not sure about this, I guess others can comment..

Hope this helps!

Cheers,

Geert

-- 

Geert Vanderkelen
http://www.some-abstract-type-shit.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to