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