| <!--#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.3 $ ($Date: 1999/08/04 18:10:40 $) |
| </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> |
| </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.linuxhq.com/HOWTO/Kernel-HOWTO.html" >Kernel |
| HOWTO</A>, or the documentation provided with your distribution, or |
| a <A HREF="http://www.linuxhq.com/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. Then try to start the server |
| again. |
| </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 --> |