⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x3381.htm

📁 Its a xmpp protocol book
💻 HTM
📖 第 1 页 / 共 3 页
字号:
of the conference service's host filter is still 
<TT
CLASS="FILENAME"
>conference.</TT
><TT
CLASS="USERINPUT"
><B
><TT
CLASS="FILENAME"
>yak</TT
></B
></TT
>
- that is the name of the host where
the satellite server runs is actually irrelevant. This is because the
conference service is still seen by the main Jabber server's 
<B
CLASS="COMMAND"
>jabberd</B
> as 'local', through the accept/connect
binding.</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="JABTDG-CH-4-SECT-4.5.3.5"
>Specify a Different PIDfile location</A
></H3
><P
>If the satellite server is going to be running on the same host as 
the main server, and from the same directory (indeed, in this example,
we've named the satellite server's configuration file 
'<TT
CLASS="FILENAME"
>jabber_conf.xml</TT
>' to distinguish it from the 
main server's '<TT
CLASS="FILENAME"
>jabber.xml</TT
>'), make sure a different
location for storing the PIDfile is specified:</P
><P
><PRE
CLASS="SCREEN"
>&#60;jabber&#62;

  &#60;service id="conflinker"&#62;

    ...

  &#60;/service&#62;

  &#60;service id='conf.yak'&#62;

    ...

  &#60;/service&#62;

  <TT
CLASS="USERINPUT"
><B
>&#60;pidfile&#62;jabber_conf.pid&#60;/pidfile&#62;</B
></TT
>

&#60;/jabber&#62;&#13;</PRE
></P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="JABTDG-CH-4-SECT-4.5.3.6"
>Start up the Main Server</A
></H3
><P
>Once everything is configured, start up the main server:</P
><P
><PRE
CLASS="SCREEN"
>yak:~/jabber-1.4.1$ <TT
CLASS="USERINPUT"
><B
>./jabberd/jabberd -c jabber.xml &#38;</B
></TT
></PRE
></P
><P
>The <TT
CLASS="LITERAL"
>&#60;accept/&#62;</TT
> section should
start listening on port 9001 for a connection.</P
><P
><PRE
CLASS="SCREEN"
>yak:~/jabber-1.4.1$ <TT
CLASS="USERINPUT"
><B
>netstat -an | grep 9001</B
></TT
>
tcp        0      0 127.0.0.1:9001          0.0.0.0:*               LISTEN</PRE
></P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="JABTDG-CH-4-SECT-4.5.3.7"
>Start up the Satellite Server</A
></H3
><P
>Now it's time to start up the satellite server. From the same directory
in this example:</P
><P
><PRE
CLASS="SCREEN"
>yak:~/jabber-1.4.1$ <TT
CLASS="USERINPUT"
><B
>./jabberd/jabberd -c jabber_conf.xml &#38;</B
></TT
></PRE
></P
><P
>The satellite server should make a connection to the socket listening on
127.0.0.1:9001.</P
><P
>At this stage, you should have Jabber server services split between a 
main process and a separate process that runs a
<I
CLASS="EMPHASIS"
>Conferencing</I
> component.</P
><P
>At the risk of stating the obvious, it is worth pointing out that this 
example shows that simply starting <B
CLASS="COMMAND"
>jabberd</B
> does not
mean that any process will bind to and start listening on port 5222. 
It is the <I
CLASS="EMPHASIS"
>jsm</I
> component that makes this happen.
So starting a second <B
CLASS="COMMAND"
>jabberd</B
> on the same host did not
cause any
socket listening problems because this second <B
CLASS="COMMAND"
>jabberd</B
>
doesn't have a jsm component and so doesn't try to bind to port 5222.</P
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="JABTDG-CH-4-SECT-4.5.4"
>Using Services on Other Jabber Servers</A
></H2
><P
>This section describes a technique that we've already seen used implicitly
in <A
HREF="x3381.htm#JABTDG-CH-4-SECT-4.5.3"
>the section called <I
>Splitting up the Jabber Server Processes</I
></A
>.
That is the use of services on <I
CLASS="EMPHASIS"
>other</I
> Jabber servers. 
In reality, the example of running a <I
CLASS="EMPHASIS"
>Conferencing</I
>
module in a satellite Jabber server showed the technique in the context
of local administrative control - we control the main and 
and satellite servers, and the module in the satellite server may rely on 
services in the main server for support.</P
><P
>But consider the <TT
CLASS="LITERAL"
>&#60;browse/&#62;</TT
>
section in the <TT
CLASS="FILENAME"
>jabber.xml</TT
> configuration file that
comes out of the box with Jabber server 1.4.1:</P
><P
><PRE
CLASS="SCREEN"
>&#60;browse&#62;

  ...

  &#60;service type="jud" jid="users.jabber.org" name="Jabber User Directory"&#62;
    &#60;ns&#62;jabber:iq:search&#60;/ns&#62;
    &#60;ns&#62;jabber:iq:register&#60;/ns&#62;
  &#60;/service&#62;

  ...

&#60;/browse&#62;</PRE
></P
><P
>What's this? A JID of <TT
CLASS="FILENAME"
>users.jabber.org</TT
>? How many 
Jabber server installations will be running with the
<TT
CLASS="FILENAME"
>jabber.org</TT
> domain name?
Yes, just one. So what this means is that this 
<TT
CLASS="LITERAL"
>&#60;browse/&#62;</TT
> section is pointing
to a <I
CLASS="EMPHASIS"
>JUD</I
> component running at <TT
CLASS="FILENAME"
>jabber.org</TT
>
as <TT
CLASS="FILENAME"
>users.jabber.org</TT
>. And if <I
CLASS="EMPHASIS"
>our</I
>
Jabber server is running the <I
CLASS="EMPHASIS"
>Server (to Server) Connections</I
>
and <I
CLASS="EMPHASIS"
>Hostname Resolution</I
> components, clients connecting
to our server can transparently jump across the wire and avail themselves
of the JUD services at <TT
CLASS="FILENAME"
>users.jabber.org</TT
>.</P
><P
>Indeed, the entry doesn't even have to be in the 
<TT
CLASS="LITERAL"
>&#60;browse/&#62;</TT
>
section - this is more for convenience, so that the clients can build a 
dynamic list of services from which the user may choose. The client may
of course offer a facility for the user to directly enter the name (hostname,
address) of the service they require.</P
><P
>How does this procedure compare to the 'satellite server' procedure?
In this case, the packets that originate from a Jabber client connected to 
our Jabber server make their
way to the JUD service on <TT
CLASS="FILENAME"
>users.jabber.org</TT
> by means
of the s2s service. That is, they travel through a connection described
by the <TT
CLASS="LITERAL"
>jabber:server</TT
> namespace. On the
other hand, packets on our server destined for a satellite conference 
service travel through a connection described by the 
<TT
CLASS="LITERAL"
>jabber:component:accept</TT
> namespace. </P
></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-4-FOOTNOTE-22"
HREF="x3381.htm#JABTDG-CH-4-FOOTNOTE-22"
>[1]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>If the <I
CLASS="EMPHASIS"
>Hostname Resolution</I
> component is configured to
run, then you will see two processes at startup, as the component - 
<TT
CLASS="FILENAME"
>dnsrv</TT
> - forks to have the resolver functionality run
in a separate child process.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.JABTDG-CH-4-FOOTNOTE-23"
HREF="x3381.htm#JABTDG-CH-4-FOOTNOTE-23"
>[2]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>'Constellation' is used in German for the word 'configuration' when referring
to system arrangement in IT. It's such a wonderfully evocative and appropriate
word - much more interesting than 'configuration' - that I've decided to use
it here. </P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.JABTDG-CH-4-FOOTNOTE-24"
HREF="x3381.htm#JABTDG-CH-4-FOOTNOTE-24"
>[3]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>That said, it <I
CLASS="EMPHASIS"
>is</I
> possible for someone registered to
b-domain to connect to and use, say, the
<I
CLASS="EMPHASIS"
>Conferencing</I
> service listening on
<TT
CLASS="LITERAL"
>conferencing.a-domain.com</TT
> - see 
<A
HREF="x3381.htm#JABTDG-CH-4-SECT-4.5.4"
>the section called <I
>Using Services on Other Jabber Servers</I
></A
> later in this Chapter.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.JABTDG-CH-4-FOOTNOTE-25"
HREF="x3381.htm#JABTDG-CH-4-FOOTNOTE-25"
>[4]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>Although the service ids do not <I
CLASS="EMPHASIS"
>need</I
> to match.</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="x3305.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="p3608.htm"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Managing the Configuration</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c1223.htm"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Putting Jabber's Concepts to Work</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -