Code

Opened 6 years ago

Closed 6 years ago

Last modified 6 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:

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.

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by PhiR

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Documentation does not provide a good method of configuring an apache server to Fastcgi/apache documentation could be simplified

comment:2 Changed 6 years ago by programmerq

  • Resolution set to worksforme
  • Status changed from new to closed

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

I would reopen this, n00bish has a valid point.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.