Apache Server Frequently Asked Questions

$Revision: 1.18 $ ($Date: 1997/04/11 03:43:43 $)

The Questions


The Answers

Background

  1. What is Apache?

    Apache was originally based on code and ideas found in the most popular HTTP server of the time.. NCSA httpd 1.3 (early 1995). It has since evolved into a far superior system which can rival (and probably surpass) almost any other UNIX based HTTP server in terms of functionality, efficiency and speed.

    Since it began, it has been completely rewritten, and includes many new features. Apache is, as of January 1997, the most popular WWW server on the Internet, according to the Netcraft Survey.


  2. Why was Apache created?

    To address the concerns of a group of WWW providers and part-time httpd programmers that httpd didn't behave as they wanted it to behave. Apache is an entirely volunteer effort, completely funded by its members, not by commercial sales.


  3. How does The Apache Group's work relate to other server efforts, such as NCSA's?

    We, of course, owe a great debt to NCSA and their programmers for making the server Apache was based on. We now, however, have our own server, and our project is mostly our own. The Apache Project is an entirely independent venture.


  4. Why the name "Apache"?

    A cute name which stuck. Apache is "A PAtCHy server". It was based on some existing code and a series of "patch files".


  5. OK, so how does Apache compare to other servers?

    For an independent assessment, see http://webcompare.iworld.com/compare/chart.html.

    Apache has been shown to be substantially faster than many other free servers. Although certain commercial servers have claimed to surpass Apache's speed (it has not been demonstrated that any of these "benchmarks" are a good way of measuring WWW server speed at any rate), we feel that it is better to have a mostly-fast free server than an extremely-fast server that costs thousands of dollars. Apache is run on sites that get millions of hits per day, and they have experienced no performance difficulties.


  6. How thoroughly tested is Apache?

    Apache is run on over 400,000 Internet servers (as of April 1997). It has been tested thoroughly by both developers and users. The Apache Group maintains rigorous standards before releasing new versions of their server, and our server runs without a hitch on over one third of all WWW servers available on the Internet. When bugs do show up, we release patches and new versions as soon as they are available.

    See http://www.apache.org/info/apache_users.html for a partial list of sites running Apache.


  7. What are the future plans for Apache?


  8. Whom do I contact for support?

    There is no official support for Apache. None of the developers want to be swamped by a flood of trivial questions that can be resolved elsewhere. Bug reports and suggestions should be sent via the bug report page . Other questions should be directed to the comp.infosystems.www.servers.unix newsgroup, where some of the Apache team lurk, in the company of many other httpd gurus who should be able to help.

    Commercial support for Apache is, however, available from a number of third parties.


  9. Is there any more information available on Apache?

    Indeed there is. See the main Apache Web site at http://www.apache.org/. There is also a regular electronic publication called Apache Week available; you can find out more about this at http://www.apacheweek.com/.


  10. Where can I get Apache?

    You can find the source for Apache at the main web page, http://www.apache.org/.


Technical Questions

  1. "Why can't I ...? Why won't ... work?" What to do in case of problems

    If you are having trouble with your Apache server software, you should take the following steps:

    1. Check the errorlog!

      Apache tries to be helpful when it encounters a problem. In many cases, it will provide some details by writing one or messages to the server error log (see the ErrorLog directive). Somethimes this is enough for you to diagnose & fix the problem yourself (such as file permissions or the like).

    2. Check the Apache bug database

      Most problems that get reported to The Apache Group are recorded in the bug database (available at http://www.apache.org/bugdb.cgi). Please check the existing reports, open and closed, before adding one. If you find that your issue has already been reported, please don't add a "me, too" report. If the original report isn't closed yet, we suggest that you check it periodically. You might also consider contacting the original submittor, because there may be an email exchange going on about the issue that isn't getting recorded in the database.

    3. Ask in the comp.infosystems.www.servers.unix USENET newsgroup

      A lot of common problems never make it to the bug database because there's already high Q&A traffic about them in the comp.infosystems.www.servers.unix newsgroup. Many Apache users, and some of the developers, can be found roaming its virtual halls, so it is suggested that you seek wisdom there. The chances are good that you'll get a faster answer there than from the bug database, even if you don't see your question already posted.

    4. If all else fails, report the problem in the bug database

      If you've gone through those steps above that are appropriate and have obtained no relief, then please do let The Apache Group know about the problem by logging a bug report (see http://www.apache.org/bugdb.cgi).

      If your problem involves the server crashing and generating a core dump, please include a backtrace (if possible). As an example,

           # cd ServerRoot
           # dbx httpd core
           (dbx) where
          

      (Substitute the appropiate locations for your ServerRoot and your httpd and core files.)


  2. How compatible is Apache with my existing NCSA 1.3 setup?

    Apache attempts to offer all the features and configuration options of NCSA httpd 1.3, as well as many of the additional features found in NCSA httpd 1.4 and NCSA httpd 1.5.

    NCSA httpd appears to be moving toward adding experimental features which are not generally required at the moment. Some of the experiments will succeed while others will inevitably be dropped. The Apache philosophy is to add what's needed as and when it is needed.

    Friendly interaction between Apache and NCSA developers should ensure that fundamental feature enhancments stay consistent between the two servers for the foreseeable future.


  3. How do I enable CGI execution in directories other than the ScriptAlias?

    Apache recognises all files in a directory named as a ScriptAlias as being eligible for execution rather than processing as normal documents. This applies regardless of the file name, so scripts in a ScriptAlias directory don't need to be named "*.cgi" or "*.pl" or whatever. In other words, all files in a ScriptAlias directory are scripts, as far as Apache is concerned.

    To persuade Apache to execute scripts in other locations, such as in directories where normal documents may also live, you must tell it how to recognise them - and also that it's okey to execute them.

    1. In an appropriate section of your server configuration files, add a line such as
           AddHandler cgi-script .cgi
          
      The server will then recognise that all files in that location (and its logical descendants) that end in ".cgi" are script files, not documents.
    2. Make sure that the directory location is covered by an Options declaration that includes the ExecCGI option.

  4. What does it mean when my CGIs fail with "Premature end of script headers"?

    It means just what it says: the server was expecting a complete set of HTTP headers (one or more followed by a blank line), and didn't get them. The most common cause of this is Perl scripts which haven't disabled buffering; if you insert the following statements before your first print statement, this will probably go away.

       $cfh = select (STDOUT);
       $| = 1;
       select ($cfh);
      

    If your script isn't written in Perl, do the equivalent thing for whatever language you are using (e.g., for C, call fflush() after writing the headers).


  5. How do I enable SSI (parsed HTML)?


  6. Why don't my parsed files get cached?

    Since the server is performing run-time processing of your SSI directives, which may change the content shipped to the client, it can't know at the time it starts parsing what the final size of the result will be, or whether the parsed result will always be the same. This means that it can't generate Content-Length or Last-Modified headers. Caches commonly work by comparing the Last-Modified of what's in the cache with that being delivered by the server. Since the server isn't sending that header for a parsed document, whatever's doing the caching can't tell whether the document has changed or not - and so fetches it again to be on the safe side.

    You can work around this in some cases by causing an Expires header to be generated. (See the mod_expires documentation for more details.) Another possibility is to use the XBitHack Full mechanism, which tells Apache to send (under certain circumstances detailed in the XBitHack directive description) a Last-Modified header based upon the last modification time of the file being parsed. Note that this may actually be lying to the client if the parsed file doesn't change but the SSI-inserted content does.


  7. How can I have my script output parsed?

    So you want to include SSI directives in the output from your CGI script, but can't figure out how to do it? The short answer is "you can't." This has been regarded as a security liability, and the basic solution is for your script itself to do what the SSIs would be doing. After all, it's generating the rest of the content.


  8. Does or will Apache act as a Proxy server?

    Apache version 1.1 and above comes with a proxy module. If compiled in, this will make Apache act as a caching-proxy server. This module is still considered experimental, however.


  9. What are "multiviews"?

    "Multiviews" is the general name given to the Apache server's ability to provide language-specific document variants in response to a request. This is documented quite thoroughly in the content negotiation description page.


  10. Why can't I run more than <n> virtual hosts?

    The Apache server can behave unpredictably when it encounters some resource limitations. One of these is the per-process limit on file descriptors, and that's almost always the cause of problems seen when adding virtual hosts. In this case, it is often not actually Apache that's encountering the problem, but some library routine (such as gethostbyname()) which needs file descriptors and doesn't complain intelligibly when it can't get them.

    Each log file requires a file descriptor, which means that if you are using seperate access and error logs for each virtual host each virtual host needs two file descriptors. Each Listen directive also needs a file descriptor.

    Typical values for <n> that we've seen are in the neighbourhoods of 128 or 250. When the server bumps into the file descriptor limit, it may dump core with a SIGSEGV, or it might just hang, or it may limp along and you'll see (possibly meaningful) errors in the error log. One common problem that occurs when you run into a file descriptor limit is that CGI scripts stop being executed properly at times.

    As to what you can do about this:

    1. Reduce the number of Listen directives. If there are no other servers running on the machine and all of them are running on the same port, you normally don't need any Listen directives at all.
    2. Reduce the number of log files. You can use log_mod_config to log all requests to a single log file while including the name of the virtual host in the log file.
    3. Increase the number of file descriptors available to the server (see your system's documentation on the limit or ulimit commands). For some systems, information on how to do this is available in the performance hints page.
    4. "Don't do that" - try to run with fewer virtual hosts
    5. Spread your operation across multiple server processes and/or ports

    Since this is an operating-system limitation, there's not much else available in the way of solutions.


  11. Why do I keep getting "access denied" for form POST requests?

    The most common cause of this is a <Limit> section that only names the GET method. Look in your configuration files for something that resembles the following and would affect the location where the POST-handling script resides:

       <Limit GET>
          :
      

    Change that to <Limit GET POST> and the problem will probably go away.


  12. Can I use my /etc/passwd file for Web page authentication?

    Yes, you can - but it's a very bad idea. Here are some of the reasons:

    If you still want to do this in light of the above disadvantages, the method is left as an exercise for the reader. It'll void your Apache warranty, though, and you'll lose all accumulated UNIX guru points.