# jabberd2 doesn't work

## neonknight

Hello

I've been trying to get this thing to work for much too long now...

The problem is quite simple: Whenever I try to connect to my server, gaim starts a connection, closes it immediatly and says: "unknown host"

I use jabberd2 (2.0-r2)

Other clients and clients from the internet cannot connect either.

jabberd starts up correctly and the server-logfiles do not show any obvious errors. 

Most of the jabberd-documentation is not available due to the recently detected rootkit on the jabber.org-servers, so I don't know anything else that I could do...

Gaim in debug-mode gives me the following output:

 *Quote:*   

> 
> 
> account: Connecting to account 0x81daf08. gc = 0x83be640
> 
> connection: Connecting. gc = 0x83be640
> ...

 

I think the bold part is the important thing. uuuhm... what do I need to set as domain? I thought it's important that the part behind the @ of the jabber-id of connecting clients fits the <id>-tag of /etc/jabberd/sm.xml

If I set both to "localhost" (and specify 192.168.0.5 as authentification server in gaim account config) I get a little closer to a running server (but only a little, as setting them to localhost is kind of nonsense...). Now it fails with a log-entry complaining about a non-existing table jabberd2.authreg in mysql. Of course this table does not exist as I don't have any clue how it should look like. Otherwise I would have created it. 

So, what do I need to do now?

In short:

Problem no 1 has something to do with my hostnames...

Problem no 2 is an unfinished configuration of the mysql-authentification

----------

## twstd3bc

I just installed Jabberd yesterday, and I set it up using the instructions in /usr/share/doc/jabberd-1.4.3-r4/README.Gentoo.gz.  It works fine, and I can attempt connections, but I can't for the life of me, find instructions on how to add users.  The Jabber servers are down, like you said, and all I can find is some mysql examples, which probably don't apply to Gentoo since Jabberd does depend on mysql.  Ugh.  I wish they didn't take the documentation down as well as everything else.

----------

## georwell

Make sure you have a fully qualified domain name for your server.  I think that might be the reason for the your hostname un known error.

You don't need to create users.  When a user wants to use your jabber server they just register a new account.  If you don't want this then just add a new user xml file to your spool and restart the server.

----------

## twstd3bc

 *georwell wrote:*   

> Make sure you have a fully qualified domain name for your server.  I think that might be the reason for the your hostname un known error.
> 
> You don't need to create users.  When a user wants to use your jabber server they just register a new account.  If you don't want this then just add a new user xml file to your spool and restart the server.

 

I guess I don't know how to register a new user since I use gaim.  Maybe I will try another client...

----------

## georwell

Since you are using jabber now you don't need a multi IM client.   :Wink: 

----------

## twstd3bc

 *georwell wrote:*   

> Since you are using jabber now you don't need a multi IM client.  ;)

 

Gaim is still useful-- I'm only using jabber for some personal contacts.  Anyway, thanks for your help-- I finally was able to create accounts by using gnome-jabber.

----------

## neonknight

 *georwell wrote:*   

> Make sure you have a fully qualified domain name for your server.  I think that might be the reason for the your hostname un known error.

 

Ah, I seem to have been wrong... I needed to change the realm-settings in /etc/jabberd/c2s.xml... but anyway, now I have at least a correctly set up fqdn  :Cool: 

Now I do not get this "host unknown" errors any more. So I'm stuck with my second problem, the "authentification error", to be more precisely: the missing mysql-table... What does this table need to look like? My jabberd-user in mysql has any rights on the concerning database, so obviously jabberd has no routine implemented to create the tables by itself  :Sad: 

----------

## neonknight

Another typical RTFM-error:

I found some doc and sql-dumps in /usr/share/doc/jabberd-2.0  :Wink: 

buuuuut: Now I get some sasl-handshake-errors... I will need to have a closer look at this tonight, now I don't have any more time for jabber...

----------

## twstd3bc

 *neonknight wrote:*   

> Now I do not get this "host unknown" errors any more. So I'm stuck with my second problem, the "authentification error", to be more precisely: the missing mysql-table... What does this table need to look like? My jabberd-user in mysql has any rights on the concerning database, so obviously jabberd has no routine implemented to create the tables by itself :(

 

I didn't bother with  mysql because it seems like unnecessary overkill.  I just followed georwell's advice by editing the /etc/jabber/multiple.xml in the two places to allow open registrations (search for "commented out so no one can register!!!" in the file).  Then I just reverted back to no open registrations, and now it all works fine.  When a user is created, a file called /var/spool/jabber/domain.name/username.xml is created, and it looks like a useful template for creating new users.  Removing users is as easy as removing their file, as far as I can tell.  Unfortunately, using this method the passwords are stored in the clear, but I'll get to that problem later...

----------

## twstd3bc

Opps!  Just realized I'm running jabberd 1.4, so my comments probably don't apply!

----------

## georwell

You don't have to use mysql.  That is only one many available auth options.  Read up in the docs a bit more.  The jabberd admin archive is good too.

Happy Jabbering!

----------

## neonknight

Using mysql seems quite handy to me, this way it is very easy to access the jabber-user-db from other programms, e.g. a web-frontend.

this the output of c2s -D 

 *Quote:*   

> 
> 
> Fri Feb  4 16:56:56 2005 main.c:264 sx sasl callback: get pass (authnid=test2, realm=neonknight.homelinux.org)
> 
> Fri Feb  4 16:56:56 2005 authreg_mysql.c:66 prepared sql: SELECT `password`,`hash`,`token`,`sequence` FROM `authreg` WHERE `username` = 'test2' AND `realm` = 'neonknight.homelinux.org'
> ...

 

so, the user does not exist, why isn't it created by default?

I guess the config is set up correctly:

 *Quote:*   

> 
> 
> <!-- Registration configuration -->
> 
>     <register>
> ...

 

Is there a working mirror of the jabberd admin archive? I guess that's hosted on jabber.org too (which means it is not available at the moment...)

----------

## georwell

Is the user actually created?  When you create a new jabber account in most clients there is an option to "Register", or create that account on the server.  Can you query the mysql db  and check if that user exists?

----------

## neonknight

No, no new user is beeing created, when gaim fails.

hmmm, interesting...

I emerged gnome-jabber and this client is able to register a new user (a new user has been created in the database)

But gaim still can't! There is no user created in the db! But I was already able to create accounts on other, official servers with gaim. 

Gaim can log in as the previously registered user

So what might be my problem?

And another problem: jabberd stores the passwords in plaintext format. Can they be encrypted somehow?

----------

## georwell

GAIM seems to be your problem.  Can you view your xml stream using GAIM?  That could help you debug the problem.  I don't know why jabberd2 wouldn't allow registration with GAIM.  But I don't know if many of the big  public jabber servers are running jabberd2.

----------

## neonknight

I got it working! (wonder for how long...)

I recreated the authreg-table and set a primary key:

 *Quote:*   

> 
> 
> CREATE TABLE `authreg` (
> 
>     `id` INT primary key auto_increment,
> ...

 

instead of

 *Quote:*   

> 
> 
> CREATE TABLE `authreg` (
> 
>     `username` TINYTEXT,
> ...

 

But I don't really think that this was the real problem... I just can't recall any other changes... But hey, it works, that's the important thing!

I'm happy now and can finally start learning some accounting (I'm going to write an exam on monday, so this was the best time to start setting up a jabber-server  :Very Happy:  )

No, wait! one more thing:

How can I store encrypted passwords?

----------

## Herodot

I found the installation guide here:

http://web.archive.org/web/20040203031135/www.jabberdoc.org/jabberd_guide

----------

