Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#6593 closed (worksforme)

Fastcgi/apache documentation could be simplified

Reported by: n00bish Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I did not have any luck with the documentation at http://www.djangoproject.com/documentation/fastcgi/ to configure fastcgi for django.

Your code is as below:

<VirtualHost 12.34.56.78>
  ServerName example.com
  DocumentRoot /home/user/public_html
  Alias /media /home/user/python/django/contrib/admin/media
  RewriteEngine On
  RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ /mysite.fcgi/$1 [QSA,L]
</VirtualHost>

I had solved the problem in many fewer lines with less effort by doing this:

<Location "/">
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule /(.*) /mysite.fcgi/$1 [QSA,L]
</Location>

While the above obviously selects for every url below root you can customize the regular expression, especially if your code is under a subdirectory, to select only the pertinent URLs for rewriting.

The above was placed in my httpd.conf, and the

FastCGIExternalServer /home/user/public_html/mysite.fcgi -host 127.0.0.1:3033

code was placed just below it.

You could add in the /media rewrite rule that exists already for your host, if you so desired. This is a simpler, painless method. The method you described actually did not work for me, so posting this as an alternative could help many. If you need more information or a clearer description, feel free to contact me.

Change History (3)

comment:1 by Philippe Raoult, 17 years ago

Summary: Documentation does not provide a good method of configuring an apache serverFastcgi/apache documentation could be simplified

comment:2 by Jeff Anderson, 16 years ago

Resolution: worksforme
Status: newclosed

I do understand your reasoning for simplifying the example, but the existing example is a more complete example. The django doc assumes some familiarity with apache configuration files, and tweaking the config is to be expected no matter what example is given.

comment:3 by mrts, 16 years ago

I would reopen this, n00bish has a valid point.

Note: See TracTickets for help on using tickets.
Back to Top