FAQ-F.html revision 235a3e48d17b30fafb12619ee145300bdb67dd00
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!--#if expr="$FAQMASTER" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#set var="STANDALONE" value="" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#set var="INCLUDED" value="YES" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#if expr="$QUERY_STRING = TOC" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#set var="TOC" value="YES" -->
82391de567696f10b21a762fde6a06fe3c266d28vboxsync <!--#set var="CONTENT" value="" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#else -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#set var="TOC" value="" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#set var="CONTENT" value="YES" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#endif -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!--#else -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#set var="STANDALONE" value="YES" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#set var="INCLUDED" value="" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#set var="TOC" value="" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#set var="CONTENT" value="" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!--#endif -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!--#if expr="$STANDALONE" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <TITLE>Apache Server Frequently Asked Questions</TITLE>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync BGCOLOR="#FFFFFF"
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync TEXT="#000000"
99f33ab590a3a65e0cd082dd8d67779efb9cc6c9vboxsync LINK="#0000FF"
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync VLINK="#000080"
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync ALINK="#FF0000"
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <!--#include virtual="header.html" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <H1 ALIGN="CENTER">Apache Server Frequently Asked Questions</H1>
82391de567696f10b21a762fde6a06fe3c266d28vboxsync The latest version of this FAQ is always available from the main
82391de567696f10b21a762fde6a06fe3c266d28vboxsync Apache web site, at
82391de567696f10b21a762fde6a06fe3c266d28vboxsync ><SAMP>http://www.apache.org/docs/misc/FAQ.html</SAMP></A>>.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- Notes about changes: -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- - If adding a relative link to another part of the -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- documentation, *do* include the ".html" portion. There's a -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- good chance that the user will be reading the documentation -->
82391de567696f10b21a762fde6a06fe3c266d28vboxsync<!-- on his own system, which may not be configured for -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- multiviews. -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- - When adding items, make sure they're put in the right place -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- - verify that the numbering matches up. -->
82391de567696f10b21a762fde6a06fe3c266d28vboxsync<!-- - *Don't* use <PRE></PRE> blocks - they don't appear -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- correctly in a reliable way when this is converted to text -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- with Lynx. Use <DL><DD><CODE>xxx<BR>xx</CODE></DD></DL> -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- blocks inside a <P></P> instead. This is necessary to get -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- the horizontal and vertical indenting right. -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- - Don't forget to include an HR tag after the last /P tag -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!-- but before the /LI in an item. -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync If you are reading a text-only version of this FAQ, you may find numbers
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync enclosed in brackets (such as "[12]"). These refer to the list of
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync reference URLs to be found at the end of the document. These references
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync do not appear, and are not needed, for the hypertext version.
82391de567696f10b21a762fde6a06fe3c266d28vboxsync<!--#endif -->
82391de567696f10b21a762fde6a06fe3c266d28vboxsync<!--#if expr="$TOC || $STANDALONE" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI VALUE="6"><STRONG>Dynamic Content (CGI and SSI)</STRONG>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#CGIoutsideScriptAlias">How do I enable CGI execution
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync in directories other than the ScriptAlias?</A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#premature-script-headers">What does it mean when my
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync CGIs fail with "<SAMP>Premature end of script
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#POSTnotallowed">Why do I keep getting "Method Not
82391de567696f10b21a762fde6a06fe3c266d28vboxsync Allowed" for form POST requests?</A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#nph-scripts">How can I get my script's output without
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync Apache buffering it? Why doesn't my server push work?</A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#cgi-spec">Where can I find the "CGI
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync specification"?</A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#fastcgi">Why isn't FastCGI included with Apache any
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#ssi-part-i">How do I enable SSI (parsed HTML)?</A>
82391de567696f10b21a762fde6a06fe3c266d28vboxsync <LI><A HREF="#ssi-part-ii">Why don't my parsed files get cached?</A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#ssi-part-iii">How can I have my script output parsed?</A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#ssi-part-iv">SSIs don't work for VirtualHosts and/or
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync user home directories</A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#errordocssi">How can I use <CODE>ErrorDocument</CODE>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync and SSI to simplify customized error messages?</A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#remote-user-var">Why is the environment variable
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI><A HREF="#user-cgi">How do I allow each of my user directories
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync to have a cgi-bin directory?</A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!--#endif -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync<!--#if expr="$STANDALONE" -->
82391de567696f10b21a762fde6a06fe3c266d28vboxsync<!--#endif -->
82391de567696f10b21a762fde6a06fe3c266d28vboxsync<!--#if expr="! $TOC" -->
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <STRONG>How do I enable CGI execution in directories other than
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync the ScriptAlias?</STRONG>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync Apache recognizes all files in a directory named as a
6aa04d8e8d3a39ca628c07d7f800cd681cf2c40fvboxsync <A HREF="/mod/mod_alias.html#scriptalias"><SAMP>ScriptAlias</SAMP></A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync as being eligible for execution rather than processing as normal
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync documents. This applies regardless of the file name, so scripts in a
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync ScriptAlias directory don't need to be named
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync "<SAMP>*.cgi</SAMP>" or "<SAMP>*.pl</SAMP>" or
82391de567696f10b21a762fde6a06fe3c266d28vboxsync whatever. In other words, <EM>all</EM> files in a ScriptAlias
82391de567696f10b21a762fde6a06fe3c266d28vboxsync directory are scripts, as far as Apache is concerned.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync To persuade Apache to execute scripts in other locations, such as in
82391de567696f10b21a762fde6a06fe3c266d28vboxsync directories where normal documents may also live, you must tell it how
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync to recognize them - and also that it's okay to execute them. For
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync this, you need to use something like the
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <A HREF="/mod/mod_mime.html#addhandler"><SAMP>AddHandler</SAMP></A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI>In an appropriate section of your server configuration files, add
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync a line such as
82391de567696f10b21a762fde6a06fe3c266d28vboxsync The server will then recognize that all files in that location (and
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync its logical descendants) that end in "<SAMP>.cgi</SAMP>"
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync are script files, not documents.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI>Make sure that the directory location is covered by an
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <A HREF="/mod/core.html#options"><SAMP>Options</SAMP></A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync declaration that includes the <SAMP>ExecCGI</SAMP> option.
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync In some situations, you might not want to actually
82391de567696f10b21a762fde6a06fe3c266d28vboxsync allow all files named "<SAMP>*.cgi</SAMP>" to be executable.
82391de567696f10b21a762fde6a06fe3c266d28vboxsync Perhaps all you want is to enable a particular file in a normal directory to
82391de567696f10b21a762fde6a06fe3c266d28vboxsync be executable. This can be alternatively accomplished
82391de567696f10b21a762fde6a06fe3c266d28vboxsync <EM>via</EM> <A HREF="/mod/mod_rewrite.html"><SAMP>mod_rewrite</SAMP></A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync and the following steps:
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI>Locally add to the corresponding <SAMP>.htaccess</SAMP> file a ruleset
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync similar to this one:
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync RewriteRule ^quux\.cgi$ - [T=application/x-httpd-cgi]</CODE>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <LI>Make sure that the directory location is covered by an
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <A HREF="/mod/core.html#options"><SAMP>Options</SAMP></A>
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync declaration that includes the <SAMP>ExecCGI</SAMP> and
2a171646d32f8a15e9820d6fb3bf3f9b9990ca3fvboxsync <STRONG>What does it mean when my CGIs fail with
<!--#include virtual="footer.html" -->