?? x828.htm
字號(hào):
VALIGN="TOP"
>Used to specify 'home' folder or directory</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="OPTION"
>-s</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Spool area</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>The directory where the Jabber Server stores data via the
<TT
CLASS="FILENAME"
>xdb_file</TT
> module</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="OPTION"
>-v</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Show version</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Reports Jabber Server version and exits</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="OPTION"
>-V</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Show version</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Same as <TT
CLASS="OPTION"
>-v</TT
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="OPTION"
>-Z</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Debugging info</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>Limit the debugging information to certain 'zones' (comma separated)
<A
NAME="JABTDG-CH-3-FOOTNOTE-T1"
HREF="#FTN.JABTDG-CH-3-FOOTNOTE-T1"
>[a]</A
> </TD
></TR
></TBODY
><TR
><TD
COLSPAN="3"
>Notes:<BR><A
NAME="FTN.JABTDG-CH-3-FOOTNOTE-T1"
>a. </A
>the 'zones' are the filenames that immediately follow the timestamp in the
debug log records, for example 'xdb_file' or 'deliver'.<BR></TD
></TR
></TABLE
></DIV
><P
>Starting the Jabber Server with any unrecognized switches will cause it
to show you a list of valid switches:</P
><P
><PRE
CLASS="SCREEN"
>[yak: ~/jabber-1.4.1]$ <TT
CLASS="USERINPUT"
><B
>./jabberd/jabberd -badswitch</B
></TT
>
Usage:
jabberd &
Optional Parameters:
-c configuration file
-D enable debug output
-H location of home folder
-v server version
-V server version</PRE
></P
><P
>Yes, the list isn't complete. If the common switch
<TT
CLASS="OPTION"
>-h</TT
> were present in the list, we could almost
consider the unlisted switches as undocumented, but it is isn't present,
so we won't.</P
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="JABTDG-CH-3-SECT-3.1.5"
>Monitoring and Troubleshooting</A
></H2
><P
>We've already seen a glimpse of the configuration relating to logging of
messages in the previous section. As standard, the Jabber Server configuration
describes two types of logging record and a recipient file for each type:</P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>Error logging</DT
><DD
><P
>Error log records are written to <TT
CLASS="FILENAME"
>error.log</TT
> in the
current directory, as determined thus:</P
><P
><PRE
CLASS="SCREEN"
><log id='elogger'>
<host/>
<logtype/>
<format>%d: [%t] (%h): %s</format>
<file><TT
CLASS="USERINPUT"
><B
>error.log</B
></TT
></file>
<stderr/>
</log></PRE
></P
></DD
><DT
>Statistical logging</DT
><DD
><P
>Statistical log records used for tracking purposes are written to
<TT
CLASS="FILENAME"
>record.log</TT
> in the current directory, as determined thus:</P
><P
><PRE
CLASS="SCREEN"
><log id='rlogger'>
<host/>
<logtype>record</logtype>
<format>%d %h %s</format>
<file><TT
CLASS="USERINPUT"
><B
>record.log</B
></TT
></file>
</log></PRE
></P
><P
>Log records of this type are written when a client connects to the server,
and when a client disconnects.</P
></DD
></DL
></DIV
><P
>Furthermore, we can use the debugging switch (<TT
CLASS="OPTION"
>-D</TT
>) when we
start the server and have debugging and trace output written to STDERR. </P
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="JABTDG-CH-3-SECT-3.1.5.1"
>If your Server Doesn't Start</A
></H3
><P
>There are a number of things to check that are likely candidates for
preventing your server from starting.</P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>Bad XML configuration</DT
><DD
><P
>It is not difficult to make errors (typographical or otherwise) in the
server configuration. The first line of defense is to be careful
when editing your <TT
CLASS="FILENAME"
>jabber.xml</TT
> file. After that,
the Jabber Server isn't going to be too forthcoming with information if
you have broken the well-formedness of the XML:</P
><P
><PRE
CLASS="SCREEN"
>yak:~/jabber-1.4.1$ <TT
CLASS="USERINPUT"
><B
>./jabberd/jabberd -h yak</B
></TT
>
Configuration parsing using jabber.xml failed</PRE
></P
><P
>Help is at hand in the shape of Perl and the XML::Parser module, which
is a wrapper around the XML parser, <B
CLASS="COMMAND"
>expat</B
>.</P
><P
>Providing you have Perl and the XML::Parser module installed, you can
get <B
CLASS="COMMAND"
>expat</B
> to give you a clue where the XML is broken:</P
><P
><PRE
CLASS="SCREEN"
>yak:~/jabber-1.4.1$ perl -MXML::Parser -e 'XML::Parser->new->parsefile("jabber.xml", ErrorContext => 3)'
not well-formed (invalid token) at line 47, column 35, byte 1750:
be on one line, the server doesn't like it otherwise! :)
-->
<host><jabberd:cmdline flag="h"yak</jabberd:cmdline></host>
==================================^
&lt;!--
This is the custom configuration section for the
at /usr/local/lib/perl5/site_perl/5.6.0/i586-linux/XML/Parser.pm line 185
yak:~/jabber-1.4.1$</PRE
></P
><P
>This shows us exactly where our problem is. In this case I inadvertently
removed
the close-tag symbol ">" when replacing <TT
CLASS="FILENAME"
>localhost</TT
>
with <TT
CLASS="FILENAME"
>yak</TT
>. </P
></DD
></DL
></DIV
><TABLE
CLASS="SIDEBAR"
BORDER="1"
CELLPADDING="5"
><TR
><TD
><DIV
CLASS="SIDEBAR"
><A
NAME="AEN1190"
></A
><P
><B
>No XML is Bad XML!</B
></P
><P
>If you don't use the <TT
CLASS="OPTION"
>-c</TT
> switch to specify which configuration
file to use, the standard <TT
CLASS="FILENAME"
>jabber.xml</TT
> will be used.
But if that file cannot be found, you get <I
CLASS="EMPHASIS"
>exactly the same error</I
> as if your XML was not well-formed. You have been warned!</P
></DIV
></TD
></TR
></TABLE
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>Unable to Listen On Port(s)</DT
><DD
><P
>Taking the standard <TT
CLASS="FILENAME"
>jabber.xml</TT
> configuration,
the Jabber Server will try to bind to and listen on two ports: 5222 (for
incoming client connections) and 5269 (for server to server connections).
If other processes are already listening to these ports, then the Jabber
Server cannot start and you will see something like this in the
<TT
CLASS="FILENAME"
>error log</TT
>:</P
><P
><PRE
CLASS="SCREEN"
>20010407T12:11:06: [alert] (-internal): io_select unable to listen on 5222 [(null)]
20010406T12:11:06: [alert] (-internal): io_select unable to listen on 5269 [(null)]</PRE
></P
><P
>If this is the case, you can check
the status of the ports with the <B
CLASS="COMMAND"
>netstat</B
> command:</P
><P
><PRE
CLASS="SCREEN"
>yak:~/jabber-1.4.1$ <TT
CLASS="USERINPUT"
><B
>netstat -an | grep -E '5222|5269'</B
></TT
>
tcp 0 0 0.0.0.0:5269 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN</PRE
></P
><P
>If you see entries like this, it means that processes have been bound to
these ports on <I
CLASS="EMPHASIS"
>all</I
> IP addresses.
<A
NAME="JABTDG-CH-3-FOOTNOTE-4"
HREF="#FTN.JABTDG-CH-3-FOOTNOTE-4"
>[4]</A
>
For example, if
<TT
CLASS="LITERAL"
>0.0.0.0:5222</TT
> is being
listened to then you may have another
instance of a Jabber Server already running. </P
><P
>On BSD systems, you cannot bind to the 'default' null address; the same
error messages will be issued as if the ports were already bound. In the
standard <TT
CLASS="FILENAME"
>jabber.xml</TT
> configuration file, a bind
to the null address is specified for each port as standard; what
you must do is change this and specify an explicit IP address for each of
the ports in the configuration. That is, instead of:</P
><P
><PRE
CLASS="SCREEN"
><ip port="5222"/></PRE
></P
><P
>do something like this:</P
><P
><PRE
CLASS="SCREEN"
><ip port="5222">127.0.0.1</ip></PRE
></P
></DD
></DL
></DIV
></DIV
></DIV
></DIV
><H3
CLASS="FOOTNOTES"
>Notes</H3
><TABLE
BORDER="0"
CLASS="FOOTNOTES"
WIDTH="100%"
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.JABTDG-CH-3-FOOTNOTE-2"
HREF="x828.htm#JABTDG-CH-3-FOOTNOTE-2"
>[1]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>If you want the Jabber Server to support
SSL connections, you will need to have installed an SSL package; see the
next chapter for more details.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.JABTDG-CH-3-FOOTNOTE-3"
HREF="x828.htm#JABTDG-CH-3-FOOTNOTE-3"
>[2]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>A "virtual" business card containing contact information.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.AEN1016"
HREF="x828.htm#AEN1016"
>[3]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>Some Jabber clients such as Jabber Instant Messenger require
vCard information to be entered when registering for a new account, which
means that an attempt to contact
<TT
CLASS="LITERAL"
>users.jabber.org</TT
>
would be made the first time a user connects.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.JABTDG-CH-3-FOOTNOTE-4"
HREF="x828.htm#JABTDG-CH-3-FOOTNOTE-4"
>[4]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>This "all" relates to the
<TT
CLASS="LITERAL"
>(null)</TT
> shown in the "unable to listen"
error messages shown earlier.</P
></TD
></TR
></TABLE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="c813.htm"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.htm"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="c1223.htm"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Installing the Jabber Server</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c813.htm"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Server Architecture and Configuration</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -