On Sep 14, 1:31 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I did it on Apache with mod-python.  The problem I ran into was that I
> couldn't deploy Django to the root of my site and still serve up other
> content.  I ended up having trac and my Django site sitting in
> subdirectories, /trac and /home respectively.  If I want I can use mod-
> rewrite or something to send a request for / to /home and then
> browsing will be normal at that point.

That sort of thing can be done using mod_python and without using
mod_rewrite, although it does get a bit messy because of how in
general one has to use Location directory to configure Django to run
under mod_python.

FWIW, it is much simpler to do when using mod_wsgi. As example, see
configuration below, which shows combining of Django and Trac plus
serving up of designated static files. I have used daemon mode of
mod_wsgi here so that Django and Trac will run in separate processes
to Apache child processes.

WSGIDaemonProcess django threads=25
WSGIDaemonProcess trac processes=2 threads=10 maximum-requests=500

Alias /favicon.ico /usr/local/mysite/static/favicon.ico

AliasMatch /([^/]*.css) /usr/local/mysite/static/styles/$1

<Directory /usr/local/mysite/static>
Order deny,allow
Allow from all
</Directory>

WSGIScriptAlias /trac /usr/local/trac/mysite/apache/trac.wsgi

<Directory /usr/local/trac/mysite/apache>
WSGIProcessGroup trac
Order deny,allow
Allow from all
</Directory>

Alias /media/ /usr/local/django/mysite/media/

<Directory /usr/local/django/mysite/media>
Order deny,allow
Allow from all
</Directory>

WSGIScriptAlias / /usr/local/django/mysite/apache/django.wsgi

<Directory /usr/local/django/mysite/apache>
WSGIProcessGroup django
Order deny,allow
Allow from all
</Directory>

Using mod_rewrite one could probably get even trickier by providing a
rewrite rule that explicitly checked first to see if a static file
existed in static document root and allowing that to override things
and not trigger Django as a consequence. That way you could just dump
arbitrary static files in document root and they would take
precedence.

For more information on mod_wsgi configuration see:

http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines
http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac

Graham

> On Sep 13, 5:19 am, est <[EMAIL PROTECTED]> wrote:
>
> > Could I install django onwww.xxx.comwhiletrac nicely onwww.xxx.com/trac/
> > ?
>
> > My lighttpd.conf is something like this but it is not working
>
> > $HTTP["host"] == "labs.dormforce.net" {
> >         server.document-root = "/srv/dormlabs/django-projects/
> > labtest"
> >         fastcgi.server = (
> >                 "/django-projects.fcgi" => (
> >                         "main" => (
> >                                 # Use host / port instead of socket
> > for TCP fastcgi
> >                                 # "host" => "127.0.0.1",
> >                                 # "port" => 3033,
> >                                 "socket" => "/home/est/django-
> > projects.sock",
> >                                 "check-local" => "disable",
> >                         )
> >                 ),
> >         )
> >         alias.url = (
> >                 "/media/" => "/srv/dormlabs/django-projects/media/",
> >         )
>
> >         url.rewrite-once = (
> >                 "^(/media.*)$" => "$1",
> >                 "^/favicon\.ico$" => "/media/favicon.ico",
> >                 "^(/.*)$" => "/django-projects.fcgi$1",
> >         )
>
> > }
>
> > $HTTP["url"] =~ "^/trac/.*$" {
>
> >         fastcgi.server += ("/trac" =>
> >                 ("trac" =>
> >                         (
> >                         "socket" => "/tmp/trac-fastcgi.sock",
> >                         "bin-path" => "/opt/trac-0.10.4/share/trac/cgi-
> > bin/trac.fcgi",
> >                         "check-local" => "disable",
> >                         "bin-environment" =>  ("TRAC_ENV" =>
> >                                 "/srv/dormlabs/trac")
> >                         )
> >                 )
> >         )


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to