Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#6593 closed (worksforme)

Fastcgi/apache documentation could be simplified

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


I did not have any luck with the documentation at to configure fastcgi for django.

Your code is as below:

  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]

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]

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

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 Changed 10 years ago by Philippe Raoult

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

comment:2 Changed 10 years ago by Jeff Anderson

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 Changed 10 years ago by mrts

I would reopen this, n00bish has a valid point.

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