  Apache setup
  ============
  
  To use Django with Apache and FastCGI, you'll need Apache installed and
  configured, with mod_fastcgi installed and enabled. Consult the Apache
  documentation for instructions.
  
  Add the following to your ``httpd.conf``::
  
      # Connect to FastCGI via a socket / named pipe
 
</s> remove Add the following to your ``httpd.conf``::
 </s> add Once you've got that set up, point Apache at your Django FastCGI instance by
editing the ``httpd.conf`` (Apache configuration) file. You'll need to do two
things: </s> remove     # Connect to FastCGI via a socket / named pipe
 </s> add     * Use the ``FastCGIExternalServer`` directive to specify the location of
      your FastCGI server.
    * Use ``mod_rewrite`` to point URLs at FastCGI as appropriate.

.. _mod_fastcgi: http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html

Specifying the location of the FastCGI server
---------------------------------------------

The ``FastCGIExternalServer`` directive tells Apache how to find your FastCGI
server. As the `FastCGIExternalServer docs`_ explain, you can specify either a
``socket`` or a ``host``. Here are examples of both::

    # Connect to FastCGI via a socket / named pipe. </s> remove     <VirtualHost 64.92.160.91>
      ServerName mysite.com
 </s> add     # Connect to FastCGI via a TCP host/port.
    FastCGIExternalServer /home/user/public_html/mysite.fcgi -host 127.0.0.1:3033

In either case, the file ``/home/user/public_html/mysite.fcgi`` doesn't
actually have to exist. It's just a URL used by the Web server internally -- a
hook for signifying which requests at a URL should be handled by FastCGI. (More
on this in the next section.)

.. _FastCGIExternalServer docs: http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html#FastCgiExternalServer

Using mod_rewrite to point URLs at FastCGI
------------------------------------------

The second step is telling Apache to use FastCGI for URLs that match a certain
pattern. To do this, use the `mod_rewrite`_ module and rewrite URLs to
``mysite.fcgi`` (or whatever you specified in the ``FastCGIExternalServer``
directive, as explained in the previous section).

In this example, we tell Apache to use FastCGI to handle any request that
doesn't represent a file on the filesystem and doesn't start with ``/media/``.
This is probably the most common case, if you're using Django's admin site::

    <VirtualHost 12.34.56.78>
      ServerName example.com </s> remove     # Connect to FastCGI via a TCP host/port
    # FastCGIExternalServer /home/user/public_html/mysite.fcgi -host 127.0.0.1:3033
 </s> add  </s> remove LigHTTPd Setup
 </s> add lighttpd setup
configured, with `mod_fastcgi`_ installed and enabled. Consult the Apache
  Apache setup
  ============
  
  To use Django with Apache and FastCGI, you'll need Apache installed and
configured, with `mod_fastcgi`_ installed and enabled. Consult the Apache
  documentation for instructions.
  
  Add the following to your ``httpd.conf``::
  
      # Connect to FastCGI via a socket / named pipe
keep keep keep keep replace keep keep keep keep keep
 More proofreading to docs/fastcgi.txt. Still not finished.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3204 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
docs/fastcgi.txt