mirror of
https://github.com/apache/httpd.git
synced 2025-05-17 15:21:13 +03:00
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86931 13f79535-47bb-0310-9956-ffa450edef68
433 lines
17 KiB
HTML
433 lines
17 KiB
HTML
<!--#if expr="$FAQMASTER" -->
|
|
<!--#set var="STANDALONE" value="" -->
|
|
<!--#set var="INCLUDED" value="YES" -->
|
|
<!--#if expr="$QUERY_STRING = TOC" -->
|
|
<!--#set var="TOC" value="YES" -->
|
|
<!--#set var="CONTENT" value="" -->
|
|
<!--#else -->
|
|
<!--#set var="TOC" value="" -->
|
|
<!--#set var="CONTENT" value="YES" -->
|
|
<!--#endif -->
|
|
<!--#else -->
|
|
<!--#set var="STANDALONE" value="YES" -->
|
|
<!--#set var="INCLUDED" value="" -->
|
|
<!--#set var="TOC" value="" -->
|
|
<!--#set var="CONTENT" value="" -->
|
|
<!--#endif -->
|
|
<!--#if expr="$STANDALONE" -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>Apache Server Frequently Asked Questions</TITLE>
|
|
</HEAD>
|
|
<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
|
|
<BODY
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#000080"
|
|
ALINK="#FF0000"
|
|
>
|
|
<!--#include virtual="header.html" -->
|
|
<H1 ALIGN="CENTER">Apache Server Frequently Asked Questions</H1>
|
|
<P>
|
|
$Revision: 1.7 $ ($Date: 2000/11/13 02:03:36 $)
|
|
</P>
|
|
<P>
|
|
The latest version of this FAQ is always available from the main
|
|
Apache web site, at
|
|
<<A
|
|
HREF="http://www.apache.org/docs/misc/FAQ.html"
|
|
REL="Help"
|
|
><SAMP>http://www.apache.org/docs/misc/FAQ.html</SAMP></A>>.
|
|
</P>
|
|
<!-- Notes about changes: -->
|
|
<!-- - If adding a relative link to another part of the -->
|
|
<!-- documentation, *do* include the ".html" portion. There's a -->
|
|
<!-- good chance that the user will be reading the documentation -->
|
|
<!-- on his own system, which may not be configured for -->
|
|
<!-- multiviews. -->
|
|
<!-- - When adding items, make sure they're put in the right place -->
|
|
<!-- - verify that the numbering matches up. -->
|
|
<!-- - *Don't* use <PRE></PRE> blocks - they don't appear -->
|
|
<!-- correctly in a reliable way when this is converted to text -->
|
|
<!-- with Lynx. Use <DL><DD><CODE>xxx<BR>xx</CODE></DD></DL> -->
|
|
<!-- blocks inside a <P></P> instead. This is necessary to get -->
|
|
<!-- the horizontal and vertical indenting right. -->
|
|
<!-- - Don't forget to include an HR tag after the last /P tag -->
|
|
<!-- but before the /LI in an item. -->
|
|
<P>
|
|
If you are reading a text-only version of this FAQ, you may find numbers
|
|
enclosed in brackets (such as "[12]"). These refer to the list of
|
|
reference URLs to be found at the end of the document. These references
|
|
do not appear, and are not needed, for the hypertext version.
|
|
</P>
|
|
<H2>The Questions</H2>
|
|
<OL TYPE="A">
|
|
<!--#endif -->
|
|
<!--#if expr="$TOC || $STANDALONE" -->
|
|
<LI VALUE="4"><STRONG>Error Log Messages and Problems Starting Apache</STRONG>
|
|
<OL>
|
|
<LI><A HREF="#setgid">Why do I get "<SAMP>setgid: Invalid
|
|
argument</SAMP>" at startup?</A>
|
|
</LI>
|
|
<LI><A HREF="#nodelay">Why am I getting "<SAMP>httpd: could not
|
|
set socket option TCP_NODELAY</SAMP>" in my error log?</A>
|
|
</LI>
|
|
<LI><A HREF="#peerreset">Why am I getting "<SAMP>connection
|
|
reset by peer</SAMP>" in my error log?</A>
|
|
</LI>
|
|
<LI><A HREF="#wheres-the-dump">The errorlog says Apache dumped core,
|
|
but where's the dump file?</A>
|
|
</LI>
|
|
<LI><A HREF="#linux-shmget">When I run it under Linux I get "shmget:
|
|
function not found", what should I do?</A>
|
|
</LI>
|
|
<LI><A HREF="#nfslocking">Server hangs, or fails to start, and/or error log
|
|
fills with "<SAMP>fcntl: F_SETLKW: No record locks
|
|
available</SAMP>" or similar messages</A>
|
|
</LI>
|
|
<LI><A HREF="#aixccbug">Why am I getting "<SAMP>Expected </Directory>
|
|
but saw </Directory></SAMP>" when I try to start Apache?</A>
|
|
</LI>
|
|
<LI><A HREF="#redhat">I'm using RedHat Linux and I have problems with httpd
|
|
dying randomly or not restarting properly</A>
|
|
</LI>
|
|
<LI><A HREF="#stopping">I upgraded from an Apache version earlier
|
|
than 1.2.0 and suddenly I have problems with Apache dying randomly
|
|
or not restarting properly</A>
|
|
</LI>
|
|
<LI><A HREF="#setservername">When I try to start Apache from a DOS
|
|
window, I get a message like "<samp>Cannot determine host name.
|
|
Use ServerName directive to set it manually.</samp>" What does
|
|
this mean?</A>
|
|
</LI>
|
|
<LI><A HREF="#ws2_32dll">When I try to start Apache for Windows, I get a message
|
|
like "<samp>Unable To Locate WS2_32.DLL...</samp>". What should I do?</A>
|
|
</LI>
|
|
<LI><A HREF="#WSADuplicateSocket">Apache for Windows does not start.
|
|
Error log contains this message "<samp>[crit] (10045) The attempted
|
|
operation is not supported for the type of object referenced: Parent:
|
|
WSADuplicateSocket failed for socket ###</samp>". What does this
|
|
mean?</a>
|
|
</LI>
|
|
</OL>
|
|
</LI>
|
|
<!--#endif -->
|
|
<!--#if expr="$STANDALONE" -->
|
|
</OL>
|
|
|
|
<HR>
|
|
|
|
<H2>The Answers</H2>
|
|
<!--#endif -->
|
|
<!--#if expr="! $TOC" -->
|
|
|
|
<H3>D. Error Log Messages and Problems Starting Apache</H3>
|
|
<OL>
|
|
|
|
<LI><A NAME="setgid">
|
|
<STRONG>Why do I get "<SAMP>setgid: Invalid
|
|
argument</SAMP>" at startup?</STRONG>
|
|
</A>
|
|
<P>
|
|
Your
|
|
<A HREF="../mod/core.html#group"><SAMP>Group</SAMP></A>
|
|
directive (probably in <SAMP>conf/httpd.conf</SAMP>) needs to name a
|
|
group that actually exists in the <SAMP>/etc/group</SAMP> file (or
|
|
your system's equivalent). This problem is also frequently seen when
|
|
a negative number is used in the <CODE>Group</CODE> directive
|
|
(<EM>e.g.</EM>, "<CODE>Group #-1</CODE>"). Using a group name
|
|
-- not group number -- found in your system's group database should
|
|
solve this problem in all cases.
|
|
</P>
|
|
<HR>
|
|
</LI>
|
|
|
|
<LI><A NAME="nodelay">
|
|
<STRONG>Why am I getting "<SAMP>httpd: could not set socket
|
|
option TCP_NODELAY</SAMP>" in my error log?</STRONG>
|
|
</A>
|
|
<P>
|
|
This message almost always indicates that the client disconnected
|
|
before Apache reached the point of calling <CODE>setsockopt()</CODE>
|
|
for the connection. It shouldn't occur for more than about 1% of the
|
|
requests your server handles, and it's advisory only in any case.
|
|
</P>
|
|
<HR>
|
|
</LI>
|
|
|
|
<LI><A NAME="peerreset">
|
|
<STRONG>Why am I getting "<SAMP>connection reset by
|
|
peer</SAMP>" in my error log?</STRONG>
|
|
</A>
|
|
<P>
|
|
This is a normal message and nothing about which to be alarmed. It simply
|
|
means that the client canceled the connection before it had been
|
|
completely set up - such as by the end-user pressing the "Stop"
|
|
button. People's patience being what it is, sites with response-time
|
|
problems or slow network links may experiences this more than
|
|
high-capacity ones or those with large pipes to the network.
|
|
</P>
|
|
<HR>
|
|
</LI>
|
|
|
|
<LI><A NAME="wheres-the-dump">
|
|
<STRONG>The errorlog says Apache dumped core, but where's the dump
|
|
file?</STRONG>
|
|
</A>
|
|
<P>
|
|
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 <CODE>setuid()</CODE> to dump core for security reasons;
|
|
the typical Apache setup has the server started as root to bind to
|
|
port 80, after which it changes UIDs to a non-privileged user to
|
|
serve requests.
|
|
</P>
|
|
<P>
|
|
Dealing with this is extremely operating system-specific, and may
|
|
require rebuilding your system kernel. Consult your operating system
|
|
documentation or vendor for more information about whether your system
|
|
does this and how to bypass it. If there <EM>is</EM> a documented way
|
|
of bypassing it, it is recommended that you bypass it only for the
|
|
<SAMP>httpd</SAMP> server process if possible.
|
|
</P>
|
|
<P>
|
|
The canonical location for Apache's core-dump files is the
|
|
<A HREF="../mod/core.html#serverroot">ServerRoot</A>
|
|
directory. As of Apache version 1.3, the location can be set <EM>via</EM>
|
|
the
|
|
<A HREF="../mod/core.html#coredumpdirectory"
|
|
><SAMP>CoreDumpDirectory</SAMP></A>
|
|
directive to a different directory. Make sure that this directory is
|
|
writable by the user the server runs as (as opposed to the user the server
|
|
is <EM>started</EM> as).
|
|
</P>
|
|
<HR>
|
|
</LI>
|
|
|
|
<LI><A NAME="linux-shmget">
|
|
<STRONG>When I run it under Linux I get "shmget:
|
|
function not found", what should I do?</STRONG>
|
|
</A>
|
|
<P>
|
|
Your kernel has been built without SysV IPC support. You will have
|
|
to rebuild the kernel with that support enabled (it's under the
|
|
"General Setup" submenu). Documentation for kernel
|
|
building is beyond the scope of this FAQ; you should consult the <A
|
|
HREF="http://www.redhat.com/mirrors/LDP/HOWTO/Kernel-HOWTO.html">Kernel
|
|
HOWTO</A>, or the documentation provided with your distribution, or
|
|
a <A HREF="http://www.redhat.com/mirrors/LDP/HOWTO/META-FAQ.html">Linux
|
|
newsgroup/mailing list</A>. As a last-resort workaround, you can
|
|
comment out the <CODE>#define USE_SHMGET_SCOREBOARD</CODE>
|
|
definition in the <SAMP>LINUX</SAMP> section of
|
|
<SAMP>src/conf.h</SAMP> and rebuild the server (prior to 1.3b4,
|
|
simply removing <CODE>#define HAVE_SHMGET</CODE> would have
|
|
sufficed). This will produce a server which is slower and less
|
|
reliable.
|
|
</P>
|
|
<HR>
|
|
</LI>
|
|
|
|
<LI><A NAME="nfslocking">
|
|
<STRONG>Server hangs, or fails to start, and/or error log
|
|
fills with "<SAMP>fcntl: F_SETLKW: No record locks
|
|
available</SAMP>" or similar messages</STRONG>
|
|
</A>
|
|
|
|
<P>
|
|
These are symptoms of a fine locking problem, which usually means that
|
|
the server is trying to use a synchronization file on an NFS filesystem.
|
|
</P>
|
|
<P>
|
|
Because of its parallel-operation model, the Apache Web server needs to
|
|
provide some form of synchronization when accessing certain resources.
|
|
One of these synchronization methods involves taking out locks on a file,
|
|
which means that the filesystem whereon the lockfile resides must support
|
|
locking. In many cases this means it <EM>can't</EM> be kept on an
|
|
NFS-mounted filesystem.
|
|
</P>
|
|
<P>
|
|
To cause the Web server to work around the NFS locking limitations, include
|
|
a line such as the following in your server configuration files:
|
|
</P>
|
|
<DL>
|
|
<DD><CODE>LockFile /var/run/apache-lock</CODE>
|
|
</DD>
|
|
</DL>
|
|
<P>
|
|
The directory should not be generally writable (<EM>e.g.</EM>, don't use
|
|
<SAMP>/var/tmp</SAMP>).
|
|
See the <A HREF="../mod/core.html#lockfile"><SAMP>LockFile</SAMP></A>
|
|
documentation for more information.
|
|
</P>
|
|
<HR>
|
|
</LI>
|
|
|
|
<LI><A NAME="aixccbug"><STRONG>Why am I getting "<SAMP>Expected
|
|
</Directory> but saw </Directory></SAMP>" when
|
|
I try to start Apache?</STRONG></A>
|
|
<P>
|
|
This is a known problem with certain versions of the AIX C compiler.
|
|
IBM are working on a solution, and the issue is being tracked by
|
|
<A HREF="http://bugs.apache.org/index/full/2312">problem report #2312</A>.
|
|
</P>
|
|
<HR>
|
|
</LI>
|
|
|
|
<LI><A NAME="redhat">
|
|
<STRONG>I'm using RedHat Linux and I have problems with httpd
|
|
dying randomly or not restarting properly</STRONG>
|
|
</A>
|
|
|
|
<P>
|
|
RedHat Linux versions 4.x (and possibly earlier) RPMs contain
|
|
various nasty scripts which do not stop or restart Apache properly.
|
|
These can affect you even if you're not running the RedHat supplied
|
|
RPMs.
|
|
</P>
|
|
<P>
|
|
If you're using the default install then you're probably running
|
|
Apache 1.1.3, which is outdated. From RedHat's ftp site you can
|
|
pick up a more recent RPM for Apache 1.2.x. This will solve one of
|
|
the problems.
|
|
</P>
|
|
<P>
|
|
If you're using a custom built Apache rather than the RedHat RPMs
|
|
then you should <CODE>rpm -e apache</CODE>. In particular you want
|
|
the mildly broken <CODE>/etc/logrotate.d/apache</CODE> script to be
|
|
removed, and you want the broken <CODE>/etc/rc.d/init.d/httpd</CODE>
|
|
(or <CODE>httpd.init</CODE>) script to be removed. The latter is
|
|
actually fixed by the apache-1.2.5 RPMs but if you're building your
|
|
own Apache then you probably don't want the RedHat files.
|
|
</P>
|
|
<P>
|
|
We can't stress enough how important it is for folks, <EM>especially
|
|
vendors</EM> to follow the <A HREF="../stopping.html">stopping Apache
|
|
directions</A> given in our documentation. In RedHat's defense,
|
|
the broken scripts were necessary with Apache 1.1.x because the
|
|
Linux support in 1.1.x was very poor, and there were various race
|
|
conditions on all platforms. None of this should be necessary with
|
|
Apache 1.2 and later.
|
|
</P>
|
|
<HR>
|
|
</LI>
|
|
|
|
<LI><A NAME="stopping">
|
|
<STRONG>I upgraded from an Apache version earlier
|
|
than 1.2.0 and suddenly I have problems with Apache dying randomly
|
|
or not restarting properly</STRONG>
|
|
</A>
|
|
|
|
<P>
|
|
You should read <A HREF="#redhat">the previous note</A> about
|
|
problems with RedHat installations. It is entirely likely that your
|
|
installation has start/stop/restart scripts which were built for
|
|
an earlier version of Apache. Versions earlier than 1.2.0 had
|
|
various race conditions that made it necessary to use
|
|
<CODE>kill -9</CODE> at times to take out all the httpd servers.
|
|
But that should not be necessary any longer. You should follow
|
|
the <A HREF="../stopping.html">directions on how to stop
|
|
and restart Apache</A>.
|
|
</P>
|
|
<P>As of Apache 1.3 there is a script
|
|
<CODE>src/support/apachectl</CODE> which, after a bit of
|
|
customization, is suitable for starting, stopping, and restarting
|
|
your server.
|
|
</P>
|
|
<HR>
|
|
</LI>
|
|
|
|
<LI><A name="setservername">
|
|
<b>When I try to start Apache from a DOS
|
|
window, I get a message like "<samp>Cannot determine host name.
|
|
Use ServerName directive to set it manually.</samp>" What does
|
|
this mean?</b></A>
|
|
|
|
<p>
|
|
It means what it says; the Apache software can't determine the
|
|
hostname of your system. Edit your <samp>conf\httpd.conf</samp>
|
|
file, look for the string "ServerName", and make sure there's an
|
|
uncommented directive such as
|
|
</p>
|
|
<dl>
|
|
<dd><code>ServerName localhost</code></dd>
|
|
</dl>
|
|
<p>
|
|
or
|
|
</p>
|
|
<dl>
|
|
<dd><code>ServerName www.foo.com</code></dd>
|
|
</dl>
|
|
<p>
|
|
in the file. Correct it if there one there with wrong information, or
|
|
add one if you don't already have one.
|
|
</p>
|
|
<p>
|
|
Also, make sure that your Windows system has DNS enabled. See the TCP/IP
|
|
setup component of the Networking or Internet Options control panel.
|
|
</p>
|
|
<p>
|
|
After verifying that DNS is enabled and that you have a valid hostname
|
|
in your <samp>ServerName</samp> directive, try to start the server
|
|
again.
|
|
</p>
|
|
<hr>
|
|
</LI>
|
|
<LI><A name="ws2_32dll">
|
|
<b>When I try to start Apache for Windows, I get a message
|
|
like "<samp>Unable To Locate WS2_32.DLL...</samp>". What should I do?</b></A>
|
|
<p>
|
|
Short answer: You need to install Winsock 2, available from
|
|
<A HREF="http://www.microsoft.com/windows95/downloads/">http://www.microsoft.com/windows95/downloads/</A>
|
|
</p>
|
|
<p>
|
|
Detailed answer: Prior to version 1.3.9, Apache for Windows used Winsock 1.1. Beginning with
|
|
version 1.3.9, Apache began using Winsock 2 features (specifically, WSADuplicateSocket()).
|
|
WS2_32.DLL implements the Winsock 2 API. Winsock 2 ships with Windows NT 4.0 and Windows 98.
|
|
Some of the earlier releases of Windows 95 did not include Winsock 2.
|
|
</p>
|
|
<hr>
|
|
</LI>
|
|
<LI><A name="WSADuplicateSocket">
|
|
<b>Apache for Windows does not start. Error log contains this message:
|
|
"<samp>[crit] (10045) The attempted operation is not supported for
|
|
the type of object referenced: Parent: WSADuplicateSocket failed for
|
|
socket ###</samp>". What does this mean?</b></A>
|
|
<p>
|
|
We have seen this problem when Apache is run on systems along with
|
|
Virtual Private Networking clients like Aventail Connect. Aventail Connect
|
|
is a Layered Service Provider (LSP) that inserts itself, as a "shim,"
|
|
between the Winsock 2 API and Window's native Winsock 2 implementation.
|
|
The Aventail Connect shim does not implement WSADuplicateSocket, which is
|
|
the cause of the failure.
|
|
</p>
|
|
<p>
|
|
The shim is not unloaded when Aventail Connect is shut down. Once
|
|
observed, the problem persists until the shim is either explicitly
|
|
unloaded or the machine is rebooted. Instructions for temporarily
|
|
removing the Aventail Connect V3.x shim can be found here:
|
|
"<a href="http://support.aventail.com/akb/article00386.html"
|
|
>How to Remove Aventail Connect v3.x from the LSP Order for Testing
|
|
Purposes</a>."
|
|
</p>
|
|
<p>
|
|
Another potential solution (not tested) is to add <code>apache.exe</code>
|
|
to the Aventail "Connect Exclusion List". See this link for details:
|
|
"<a href="http://support.aventail.com/akb/article00586.html"
|
|
>How to Add an Application to Aventail Connect's Application Exclusion
|
|
List</a>."
|
|
</p>
|
|
<hr>
|
|
</LI>
|
|
</OL>
|
|
<!--#endif -->
|
|
<!--#if expr="$STANDALONE" -->
|
|
<!-- Don't forget to add HR tags at the end of each list item.. -->
|
|
|
|
<!--#include virtual="footer.html" -->
|
|
</BODY>
|
|
</HTML>
|
|
<!--#endif -->
|