# Jabber server (again)

## Herodot

Hi,

there has been several posts about the jabber server recently, but none have helped me. I want to make a chat server for my intranet. No internet.

Emerging jabber-server doesn't make a jabber.xml configuration file, which is all the official guides talk about. Instead it provides several other configuration files, such as icqtrans.xml and msntrans.xmls. I'm not really sure why I'd want to support any of these protocols, but it's the only configuration provided by the ebuild. I'd rather have some basic functionality before I start loading plug-ins. I guess it's a big and well-kept secret how to actually configure the server, since I've not been able to find simple examples. Still, jabber.org has a script that makes a rudimentary jabber.xml, but I had to to edit it.

I think the ebuild should provide other configurations than what it does at present. It seems to enable everything I don't need, nothing I need, and not really telling me... Also I'm not completely convinced the permissions for the {whatever}/spool/ are correct.

Can anybody provide a simple, working jabber.xml for a simple, working intranet jabber server for at simple, not-actually-working guy?

Specifically the hostname issue is driving me insane, eventhough it should be quite simple. The server does not have a fully qualified domain name, since it's on an intranet. It has a hostname (ri) and an adress (192.168.1.254). It seems that no matter which I use in the configuration, I get different, wrong results.

Maybe I'm overlooking the real issue here, but jabber server seems to be poorly documented (despite lots of documents...) and there aren't very many useful usenet posts and such. Why won't it work??? Dammit!!!

</rant>

...I think I'll go and lie down for a while now...

----------

## bink

I've been using Jabber for a while now, so hopefully I can help.

First off it sounds like the Jabber ebuild is partially to blame, it definitely should have been packaged with a jabber.xml file.  The other xml files you see (msn, yahoo etc) would be referenced in jabber.xml, they would allow your server to run transports in a separate process... that way if the aim transport crashes your jabber server doesn't die.  Since you don't care about anything but jabber communication I'll move on.

First, I would suggest you give the JabberD Quickstart, http://jabberd.jabberstudio.org/quickstart/

It's a new tool so I haven't tried it, but the way it's described it should do exactly what you want it to do.

Failing that you can try taking a look at 

http://www.jabber.org/admin/config-examples.php

which will show you jabber.xml examples for starting everything inside on process (single.xml) and splitting them out (multiple).  I'd use multiple even though you don't care about any of the other transports.

After you get jabber.xml configured try starting jabber by doing this:

/path/to/jabberd/jabberd -Dh hostname

the D is debug, the h stands for host.  The hostname should match whatever's in jabber.xml (I think it might override what's in jabber.xml, but better safe than sorry). 

At this point you should be able to login, register a new a new jabber account, and do likewise for other people.  Since you don't care at all about internet you don't have to worry about server to server (s2s) communications or configuring the transports.

Hopefully that's helped a bit.  If you turn the D(ebug)  switch on you can get information from the server as to why it's not working.  You could either reply and let us know what's up or maybe what would be smarter is to get a client, register on jabber.org, and then go into jdev room in groupchat on conference.jabber.org.  They'll help you out as well (and no Jabber a hell of a lot better than I do!

Best of luck!

P.S.  I didn't post a working jabber.xml, but if this still doesn't work I'd be happy to post mine, just ask.

----------

## Herodot

Thanks for your answer!

Imagine: I got it working! I sat down to write a good and thorough answer, and very carefully checked every step of the process. I discovered several errors in my setup, and possibly some in the documentation. I'm now using this jabber.xml:

```

<jabber>

  <service id="sessions">

    <host><jabberd:cmdline flag="h">ri</jabberd:cmdline></host>

    <jsm xmlns="jabber:config:jsm">

      <vCard>

        <FN>Vores Jabberserver</FN>

        <DESC>Det her er ris Jabberserver</DESC>

        <URL></URL>

      </vCard>

      <register notify="yes">

        <instructions>Choose a username and password to register with thisserver.</instructions>

        <name/>

        <email/>

      </register>

      <welcome>

        <subject>Welcome!</subject>

        <body>Welcome to the Jabber server at ri</body>

      </welcome>

      <admin>

        <read>Herodot@ri</read>

        <write>Herodot@ri</write>

        <reply>

          <subject>Auto Reply</subject>

          <body>This is a special administrative address.  Your message was received and forwarded to server administrators.</body>

        </reply>

      </admin>

      <vcard2jud/>

      <browse>

        <service type="jud" jid="users.jabber.org" name="Jabber User Directory">

          <ns>jabber:iq:search</ns>

          <ns>jabber:iq:register</ns>

        </service>

      </browse>

    </jsm>

    <load main="jsm">

      <jsm>/usr/lib/jabber/jsm.so</jsm>

      <mod_echo>/usr/lib/jabber/jsm.so</mod_echo>

      <mod_roster>/usr/lib/jabber/jsm.so</mod_roster>

      <mod_time>/usr/lib/jabber/jsm.so</mod_time>

      <mod_vcard>/usr/lib/jabber/jsm.so</mod_vcard>

      <mod_last>/usr/lib/jabber/jsm.so</mod_last>

      <mod_version>/usr/lib/jabber/jsm.so</mod_version>

      <mod_announce>/usr/lib/jabber/jsm.so</mod_announce>

      <mod_agents>/usr/lib/jabber/jsm.so</mod_agents>

      <mod_browse>/usr/lib/jabber/jsm.so</mod_browse>

      <mod_admin>/usr/lib/jabber/jsm.so</mod_admin>

      <mod_filter>/usr/lib/jabber/jsm.so</mod_filter>

      <mod_offline>/usr/lib/jabber/jsm.so</mod_offline>

      <mod_presence>/usr/lib/jabber/jsm.so</mod_presence>

      <mod_auth_plain>/usr/lib/jabber/jsm.so</mod_auth_plain>

      <mod_auth_digest>/usr/lib/jabber/jsm.so</mod_auth_digest>

      <mod_auth_0k>/usr/lib/jabber/jsm.so</mod_auth_0k>

      <mod_log>/usr/lib/jabber/jsm.so</mod_log>

      <mod_register>/usr/lib/jabber/jsm.so</mod_register>

      <mod_xml>/usr/lib/jabber/jsm.so</mod_xml>

    </load>

  </service>

  <xdb id="xdb">

    <host/>

    <load>

      <xdb_file>/usr/lib/jabber/xdb_file.so</xdb_file>

    </load>

    <xdb_file xmlns="jabber:config:xdb_file">

      <spool><jabberd:cmdline flag='s'>./spool</jabberd:cmdline></spool>

    </xdb_file>

  </xdb>

  <service id="c2s">

    <load>

      <pthsock_client>/usr/lib/jabber/pthsock_client.so</pthsock_client>

    </load>

    <pthcsock xmlns='jabber:config:pth-csock'>

      <authtime/>

      <karma>

        <init>10</init>

        <max>10</max>

        <inc>1</inc>

        <dec>1</dec>

        <penalty>-6</penalty>

        <restore>10</restore>

      </karma>

      <ip port="5222"/>

    </pthcsock>

  </service>

  <log id='elogger'>

    <host/>

    <logtype/>

    <format>%d: [%t] (%h): %s</format>

    <file>error.log</file>

    <!--<stderr/>-->

  </log>

  <log id='rlogger'>

    <host/>

    <logtype>record</logtype>

    <format>%d %h %s</format>

    <file>record.log</file>

  </log>

  <io>

    <rate points="5" time="25"/>

  </io>

</jabber>

```

Note that I've specified the path to the files.

This file was originally made with the quickstart script you mention.

I'm starting the server with a slightly modified /etc/init.d/jabber: 

```

#!/sbin/runscript

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License, v2 or later

# $Header: /home/cvsroot/gentoo-x86/net-im/jabber-server/files/jabber.rc6-r1,v 1.5 2003/02/14 23:00:48 vapier Exp $

depend() {

        need net

}

start() {

        ebegin "Starting Jabber Server"

        jabberd -c /etc/jabber.xml -H /jabber &

        eend $?

}

stop() {

        ebegin "Stopping Jabber Server"

        killall jabberd

        sleep 2

        eend $?

}

```

/jabber is a folder writeable by jabber, and it has a spool/ri subfolder

I can now follow the XML examples on jabber.org, they completely borked yesterday. Using two jabber clients on my client machine, I'm now confirming that everything works. It looks like it.

So your answer helped in that it inspired me to do things properly, to "do good". Super villains whereever you are, beware! A new power has arisen!

Thanks!

<donning the cape on the way out>

----------

## puggy

Grrrrrrrr, what do I need to do to get this damn server working. Where exactly am I putting this config script to make it work? Apologies for being entirely retarded. 

Puggy

----------

## Davin

 *puggy wrote:*   

> Grrrrrrrr, what do I need to do to get this damn server working. Where exactly am I putting this config script to make it work? Apologies for being entirely retarded. 
> 
> Puggy

 

Here's how the ebuild sets up your system:

Configuration scripts: /etc/jabber/

IM user files (and .pid): /var/spool/jabber

Jabber modules: /usr/lib/jabber

Runtime logs: /var/log/jabber

To get your system up and running you'll need to tweak the hell out of the files in /etc/jabber. Each .xml file is for a seperate instance of jabber, so that you have one main instance handling the main jabber server itself and all the inter-communication, plus another instance for every "transport" you want to use.

If you don't want to use a particular transport, you'll need to edit /etc/init.d/jabber and comment out the line in question. Likewise, you'll add lines here if you need to add one.

That should be enough to get you started at least. Play around on your own, and use the configuration examples at http://www.jabber.org/admin/config-examples.php for reference if you're unsure. If you're stumped though, and there *are* a number of stumbling blocks you'll run into, leave a note here and I'll give it a shot.

IMPORTANT: If you plan on using ANY of the transports, you'll need to be using the ~i386 glibc build. (glibc-2.3.2-r1) You will undergo multiple levels of rage and insanity if you put any effort at all into getting a transport working on the glibc-2.3.1-r4 that emerge likes. In short, if you want to run a jabber server without compiling a glibc that has the potential to b0rk your other programs, you'll need to invest in a seperate testing box or usermode Linux.

----------

