From: Ken Coar
- $Revision: 1.63.2.1 $ ($Date: 1997/06/09 17:04:36 $)
+ $Revision: 1.63.2.2 $ ($Date: 1997/06/11 21:21:39 $)
The latest version of this FAQ is always available from the main
@@ -35,6 +35,11 @@
+
+
+
+
+
@@ -51,8 +56,8 @@
-
-
+
+
@@ -71,7 +76,7 @@
-
+
Apache Server Frequently Asked Questions
@@ -460,16 +471,12 @@
dump, please include a backtrace (if possible). As an example,
@@ -159,7 +164,7 @@
Apache buffering it?
struct iovec
" when compiling under Linux?
http://foo.domain.com/~user/
-
) but not when I omit it (eg. http://foo.domain.com/~user
-
)?
+ when I include the trailing "/"
+ (e.g., http://foo.domain.com/~user/) but
+ not when I omit it
+ (e.g., http://foo.domain.com/~user)?
-
-
+
-
-
# cd ServerRoot
+ # dbx httpd core
+ (dbx) where
+ (Substitute the appropriate locations for your @@ -538,15 +545,19 @@
+The server will then recognize that all files in that location (and its logical descendants) that end in ".cgi" are script files, not documents. +
+
print
or write
statement:
-
-
+
-
-
$cfh = select (STDOUT);
+ $| = 1;
+ select ($cfh);
+
This is generally only necessary when you are calling external
- programs from your script that send output to stdout.
+ programs from your script that send output to stdout, or if there will
+ be along delay between the time the headers are sent and the actual
+ content starts being emitted. To maximise performance, you should
+ turn buffering back on (with $| = 0
or the
+ equivalent) after the statements that send the headers.
If your script isn't written in Perl, do the equivalent thing for whatever language you are using (e.g., for C, call @@ -601,7 +612,13 @@ Processing a document at run-time is called parsing it; hence the term "parsed HTML" sometimes used for documents that contain SSI instructions. Parsing tends to be extremely - resource-consumptive, and is not enabled by default. + resource-consumptive, and is not enabled by default. It can also + interfere with the cachability of your documents, which can put a + further load on your server. (see the + next question + for more information about this.)
To enable SSI processing, you need to @@ -709,7 +726,11 @@ Does or will Apache act as a Proxy server?
- Apache version 1.1 and above comes with a proxy module. If compiled + Apache version 1.1 and above comes with a + proxy module. + If compiled in, this will make Apache act as a caching-proxy server.
-
-
+
-
-
<Limit GET>
:
+
- Change that to <Limit GET POST> and the problem
+ Change that to <Limit GET POST>
and the problem
will probably go away.
ErrorDocument 401
work?
- You need to use it with a URL in the form "/foo/bar" and not one - with a method and hostname such as "http://host/foo/bar". See the + You need to use it with a URL in the form + "/foo/bar" and not one with a method and + hostname such as "http://host/foo/bar". See the ErrorDocument @@ -1000,7 +1018,7 @@
BrowserMatch Java/1.0 force-response-1.0
+ BrowserMatch Java1.0 force-response-1.0
As an example how you might handle the former (in a Perl script):
-
-
- - if ($0 =~ m:/*nph-:) {
-
-
- $HTTP_headers =
- "HTTP/1.1 200 OK\015\012";
-
-
- $HTTP_headers .=
- "Connection: close\015\012";
-
-
- printf ($HTTP_headers);
-
- };
-
-
-
+ +
if ($0 =~ m:/*nph-:) {
+
+
+ $HTTP_headers =
+ "HTTP/1.1 200 OK\015\012";
+
+
+ $HTTP_headers .=
+ "Connection: close\015\012";
+
+
+ printf ($HTTP_headers);
+
+ };
+ and then follow with your normal non-nph headers.
@@ -1119,7 +1137,7 @@struct iovec
" when compiling under Linux?
This is a conflict between your C library includes and your kernel @@ -1143,7 +1161,7 @@ file?
- In Apache version 1.2 (beginning with 1.2b8), the error log message
+ In Apache version 1.2, the error log message
about dumped core includes the directory where the dump file should be
located. However, many Unixes do not allow a process that has
called setuid()
to dump core for security reasons;
@@ -1197,10 +1215,12 @@
this by adding the -DMAXIMUM_DNS clause to the
EXTRA_CFLAGS definition in your
Configuration file. For example:
+
EXTRA_CFLAGS=-DMAXIMUM_DNS
This will cause Apache to be very paranoid about making sure a particular host address is really assigned to the name it @@ -1273,10 +1293,12 @@
AddType audio/x-midi .mid .midi .kar
Note that this may break browsers that do recognize the audio/midi MIME type unless they're prepared to also @@ -1382,31 +1404,10 @@
- The Java Development Kit (JDK) libraries versions 1.0.2 and 1.1 do not - correctly interpret the "HTTP/1.1" response - header that Apache 1.2 sends. Instead, if they don't see an exact - match for "HTTP/1.0", they assume the headers - are part of the document content. -
-- This is a known problem, and it has been reported to Sun's JavaSoft - unit. In the meantime, Apache 1.2 servers can work around this by - adding the following lines to their configuration files: -
-BrowserMatch Java1.0 force-response-1.0
-
If you have installed BIND-8
@@ -1424,16 +1425,17 @@
and libraries that came with your system or make sure to use the
new include files and libraries. Adding -lbind
to the
EXTRA_LFLAGS
line in your Configuration
- file, then re-running Configure
should resolve the
+ file, then re-running Configure
, should resolve the
problem.
http://foo.domain.com/~user/
)
+ the trailing "/"
+ (e.g., http://foo.domain.com/~user/)
but not when I omit it
- (eg. http://foo.domain.com/~user
)?
+ (e.g., http://foo.domain.com/~user)?
When you access a directory without a trailing "/", Apache needs @@ -1447,59 +1449,96 @@ you need to tell it.
- Add a ServerName directive + Add a ServerName directive to the config file to tell it what the domain name of the server is.
There are several ways to do this; some of the more popular ones are to use the mod_auth, - mod_auth_db or mod_auth_dbm modules. + mod_auth_db, or + mod_auth_dbm modules.
For an explaination on how to implement these restrictions, see - ApacheWeek's - Using User Authentication or - - DBM User Authentication tutorials. + Apache Week's + articles on + Using User Authentication + or + DBM User Authentication.
- Use the Satsify directive,
- in particular the Satsify Any
directive to require
+ Use the Satisfy directive,
+ in particular the Satisfy Any
directive, to require
that only one of the access restrictions be met. For example,
- adding the following configuration to a .htaccess
+ adding the following configuration to a .htaccess
or server configuration file would restrict access to people who
either are accessing the site from a host under domain.com or
who can supply a valid username and password:
- deny from all - allow from .domain.com - AuthType Basic - AuthUserFile /usr/local/etc/httpd/conf/htpasswd.users - AuthName special directory - require valid-user - satisfy any --
See the user authentication +
+
deny from all
+ allow from .domain.com
+ AuthType Basic
+ AuthUserFile /usr/local/etc/httpd/conf/htpasswd.users
+ AuthName special directory
+ require valid-user
+ satisfy any
+ + See the user authentication question and the mod_access module for details on how the above directives work.
+ The + mod_info + module allows you to use a Web browser to see how your server is + configured. Among the information it displays is the list modules and + their configuration directives. The "current" values for + the directives are not necessarily those of the running server; they + are extracted from the configuration files themselves at the time of + the request. If the files have been changed since the server was last + reloaded, the display will will not match the values actively in use. + If the files and the path to the files are not readable by the user as + which the server is running (see the + User + directive), then mod_info cannot read them in order to + list their values. An entry will be made in the error log in + this event, however. +
+