Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Jabberd2 Server Setup Howto
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
batfoot
Apprentice
Apprentice


Joined: 26 Jul 2004
Posts: 197

PostPosted: Mon Jul 25, 2005 11:49 pm    Post subject: Jabberd2 Server Setup Howto Reply with quote

Hi all.

Here is a working howto on how to setup a base jabberd2 server on Gentoo.

1. Install OpenSSL
emerge openssl

2. Install Libidn
emerge libidn

3. Install MySQL
emerge mysql

4. Create jabber user and group.
groupadd jabber
useradd -g jabber jabber

5. Create PID file directory & set correct permissions.
mkdir -p /usr/local/var/jabberd/pid/
chown -R jabber:jabber /usr/local/var/jabberd/pid/

6. Create Log file directory & set correct permissions.
mkdir /usr/local/var/jabberd/log/
chown -R jabber:jabber /usr/local/var/jabberd/log/

7. Create initial MySQL database.
/usr/bin/mysql_install_db

8. Start MySQL.
/etc/init.d/mysql start

9. Setup MySQL password.
/usr/bin/mysqladmin -u root password 'newpassword'

10. Set MySQL to start at boot time.
rc-update add mysql default

*** At this point MySQL should be set up and ready to use. You can reboot here to ensure MySQL starts up as it should if you like.

*** There is an ebuild for jabberd1.4xx. I have had this working by just emerging the package. However if you
do this you will need to add USE="-ipv6" to your /etc/make.conf file. Unless of course you are using ipv6 in which
case you won't need to worry about it.


Installing Jabberd2.
*** I have used jabberd-2.0s8 as the example below as it is the latest version that is on their website, and
also the version that I have installed.


11. Download jabberd2 from http://jabberd.jabberstudio.org/2/ to your /root folder. Then enter your /root folder.
cd /root

12. Extract the jabberd package.
tar -zxvf jabberd-2.0s8.tar.gz

13. Enter the newly created folder.
cd jabberd-2.0s8

14. Configure the source code to run with your setup.
./configure --enable-mysql --enable-openssl --enable-idn

15. Compile the source code.
make

16. Install the jabberd package.
make install

17. Set the ownership of the jabber configuration files.
chown -R root:jabber /usr/local/etc/jabberd/*

18. Set the permissions of the jabber configuration files.
chmod -R 640 /usr/local/etc/jabberd/*

19. Enter the jabber configuration folder.
cd /usr/local/etc/jabberd/

20. Setup your hostname in both sm.xml and c2s.xml under the <id> tags.

In sm.xml :

<!-- Session manager configuration -->
<sm>
<!-- Our ID on the network. Users will have this as the domain part of
their JID. If you want your server to be accessible from other
Jabber servers, this ID must be resolvable by DNS.s
(default: localhost) -->
<id>somemachine.somedomain.com</id>

In c2s.xml :

<!-- Local network configuration -->
<local>
<!-- Who we identify ourselves as. This should correspond to the
ID (host) that the session manager thinks it is. You can
specify more than one to support virtual hosts, as long as you
have additional session manager instances on the network to
handle those hosts. The realm attribute specifies the auth/reg
or SASL authentication realm for the host. If the attribute is
not specified, the realm will be selected by the SASL
mechanism, or will be the same as the ID itself. Be aware that
users are assigned to a realm, not a host, so two hosts in the
same realm will have the same users.
If no realm is specified, it will be set to be the same as the
ID. -->
<id>somemachine.somedomain.com</id>

21. Enter your jabberd/tools source code folder again.
cd /root/jabberd-2.0s8/tools

22. Provision jabber for MySQL (MySQL should be up and running at this point).
mysql -u root -p
mysql>\. db-setup.mysql

23. Set password for your jabberd mysql user.
GRANT select,insert,delete,update ON jabberd2.*
to jabberd2@localhost IDENTIFIED by 'newpassword';
quit

24. Enter the jabberd configuration folder.
cd /usr/local/etc/jabberd

25. Configure jabberd for storage with MySQL.

In sm.xml ensure that mysql is set in the <driver> tag.

<!-- Storage database configuration -->
<storage>
<!-- By default, we use the MySQL driver for all storage -->
<driver>mysql</driver>

26. Setup the MySQL password that you created in step 23.

In sm.xml replace 'secret' with your password.

<!-- MySQL driver configuration -->
<mysql>
<!-- Database server host and port -->
<host>localhost</host>
<port>3306</port>

<!-- Database name -->
<dbname>jabberd2</dbname>

<!-- Database username and password -->
<user>jabberd2</user>
<pass>secret</pass>

<!-- Transaction support. If this is commented out, transactions
will be disabled. This might make database accesses faster,
but data may be lost if jabberd crashes.

This will need to be disabled if you are using a MySQL
earlier than v3.23.xx, as transaction support did not appear
until this version. -->
<transactions/>
</mysql>

27. Configure jabberd for authentication with MySQL.

In c2s.xml ensure that mysql is set in the <module> tag.

<!-- Authentication/registration database configuration -->
<authreg>
<!-- Backend module to use -->
<module>mysql</module>

28. Setup the MySQL password that you created in step 23, this time in c2s.xml.

In c2s.xml replace 'secret' with your mysql password in the <pass> tags.

<!-- MySQL module configuration -->
<mysql>
<!-- Database server host and port -->
<host>localhost</host>
<port>3306</port>

<!-- Database name -->
<dbname>jabberd2</dbname>

<!-- Database username and password -->
<user>jabberd2</user>
<pass>secret</pass>
</mysql>

29. Start the jabberd server.
/usr/local/bin/jabberd


OK... you're all done. All you need to do now is install client software on the client workstations. I personally use PSI for the
workplace where I am. This works nicely and does what I need it to do (send text and files).

I have installed jabberd on gentoo a few times only. However I have just installed again to test this
document and all worked fine.

Firewall.[/i]
If you have a firewall running on your jabber server, you will need to poke a hole in it for it to be used. The ports you will
need to open are...
--dport 5222,5223,5269

Good luck all. I hope this helps someone out.

>Craig :)
Back to top
View user's profile Send private message
linuxpyro
Apprentice
Apprentice


Joined: 08 Sep 2004
Posts: 255

PostPosted: Fri Jul 29, 2005 2:56 am    Post subject: Reply with quote

OK, I followed everything, but when I start Jabber I get the following error:

ERROR: sm died. Shutting down server.

Anyone seen this before?
Back to top
View user's profile Send private message
Flummi
n00b
n00b


Joined: 23 Oct 2002
Posts: 13
Location: Erfurt (Germany)

PostPosted: Sat Jul 30, 2005 12:06 pm    Post subject: Thanks... Reply with quote

... already had it working, but somehow killed it. With your short step-by-step instructions it works now again.:D

Flummi
Back to top
View user's profile Send private message
volkris
n00b
n00b


Joined: 26 May 2002
Posts: 36

PostPosted: Fri Sep 09, 2005 10:03 am    Post subject: Reply with quote

Of course, using mysql adds quite a bit of complexity to these instructions... the bdb driver is just fine and far simpler.
Back to top
View user's profile Send private message
xmwxd
n00b
n00b


Joined: 17 Sep 2004
Posts: 64

PostPosted: Tue Jan 03, 2006 9:32 am    Post subject: Reply with quote

linuxpyro wrote:
OK, I followed everything, but when I start Jabber I get the following error:

ERROR: sm died. Shutting down server.

Anyone seen this before?

I have the same problem,Because my jabberd2 was installed by emerge .

when I installed it step by step ,It works.

I don't Know which step cause this problem?

anybody can fix it?

also a problem ,How to test the server?
Back to top
View user's profile Send private message
dm3
n00b
n00b


Joined: 25 Dec 2002
Posts: 17
Location: Virginia

PostPosted: Fri Jan 06, 2006 11:40 pm    Post subject: Reply with quote

There is a mismatch between the config files and the install scripts. The files are looking for some things under /var/lib/jabberd while the install scripts create /var/jabberd. Edit these files:
Code:

c2s.xml:  <pidfile>/var/lib/jabberd/pid/c2s.pid</pidfile>
resolver.xml:  <pidfile>/var/lib/jabberd/pid/resolver.pid</pidfile>
router.xml:  <pidfile>/var/lib/jabberd/pid/router.pid</pidfile>
s2s.xml:  <pidfile>/var/lib/jabberd/pid/s2s.pid</pidfile>
sm.xml:  <pidfile>/var/lib/jabberd/pid/sm.pid</pidfile>

and remove the "lib" component from the pathname.

In sm.xml and c2s.xml you'll also need to fix the path for the database in the same way. It should look like this: <path>/var/jabberd/db</path> when you're done.
Back to top
View user's profile Send private message
ivanova
Apprentice
Apprentice


Joined: 12 Apr 2004
Posts: 158
Location: South Africa

PostPosted: Tue May 23, 2006 10:32 am    Post subject: Reply with quote

Is it possible to run jabberd on a local network without registered host name?
If someone can give some tips I'd appreciate it.
_________________
Ladies and Gentlemen... we are floating in space.
Back to top
View user's profile Send private message
xces
Guru
Guru


Joined: 11 Oct 2002
Posts: 515

PostPosted: Thu May 25, 2006 3:22 pm    Post subject: Reply with quote

ivanova wrote:
Is it possible to run jabberd on a local network without registered host name?

Of course it is. You just have to set the intended hostname in sm.xml and c2s.xml. The hostname has to be valid and should be resolvable in your local network (e. g. jabber.local with corresponding entry in /etc/hosts or your local nameserver).
Back to top
View user's profile Send private message
ivanova
Apprentice
Apprentice


Joined: 12 Apr 2004
Posts: 158
Location: South Africa

PostPosted: Thu Jun 01, 2006 6:53 am    Post subject: Reply with quote

thanks - got it working ;)
_________________
Ladies and Gentlemen... we are floating in space.
Back to top
View user's profile Send private message
sparky007
n00b
n00b


Joined: 19 Sep 2003
Posts: 15
Location: Bristol, UK

PostPosted: Mon Aug 14, 2006 12:56 pm    Post subject: Reply with quote

After following this howto and attempting to start the server, I was getting
Code:
ERROR: sm died.  Shutting down server.

or
Code:
ERROR: c2s died.  Shutting down server.

or
Code:
ERROR: s2s died.  Shutting down server.


The problem was due to setting the hostaname in the wrong id element in c2s.xml.
If you are getting this problem, make sure you set your hostname in the <id> element that is within the <local> element, not the top level <id> element.

The solution can be found here:
http://juffo.org/wiki/JabberdRouterAlreadyBound

(This is mentioned in the howto but you may have overlooked it like I did).
Back to top
View user's profile Send private message
Phobos666
Tux's lil' helper
Tux's lil' helper


Joined: 11 Feb 2006
Posts: 76
Location: Germany

PostPosted: Mon Aug 21, 2006 11:00 am    Post subject: Reply with quote

and how can i get icq/msn/yahoo to jabber with jabberd2?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum