Get the sources
We need the following:
- Bandersnatch
- Perl 5.8.x
- Perl POE
- Perl module: XML::Stream
- Perl module: Net::Jabber 2.x
- Perl module: DBI (mysql)
- Perl module: POE::Component-Jabber
- Perl module: POE::Filter-XML
Extract the Bandersnatch installation into a working directory. Install all the above modules, with their dependancies.
Configure database
Ensure that you have a working mySQL server installation. To automatically create the database permissions / structure, run the following command (as a priviledged mySQL user) from the Bandersnatch working directory:
Code:
mysql -p < bandersnatch.sql
Code:
kill -HUP `pidof mysqld`
Config files
router-users.xml
This file is where the router gets its component and secret information from for component authentication. We want to tell it about a component called "bandersnatch", whose secret is also "bandersnatch"...
Add the following lines:
Code:
<name>bandersnatch</name> <secret>bandersnatch</secret>
Code:
<users> <user> <name>jabberd</name> <secret>secret</secret> </user> <user> <name>bandersnatch</name> <secret>bandersnatch</secret> </user> </users>
router.xml
Now that we have defined our component (above), we need to give it access to connect to the router, and log messages. Edit router.xml, and at the bottom, uncomment the log type ACL, as follows:
Code:
<acl type='log'> <user>bandersnatch</user> </acl>
config.xml
Finally, we edit bandersnatch's config.xml, make sure the following are set:
Code:
<server> <connectiontype>tcpip</connectiontype> <hostname>localhost</hostname> <port>5347</port> <secret>bandersnatch</secret> </server> <component> <name>bandersnatch</name> </component>
Run it
Finally, once you've confirmed that:
- Jabberd is running properly
- MySQL is running properly
- Bandersnatch tables have been created in mySQL
- The bandersnatch2.pl script is executable ("chmod 755 bandersnatch2.pl" if it's not)
Code:
Use of uninitialized value in substitution (s///) at /usr/local/share/perl/5.8.4/POE/Component/Jabber/Client/J2.pm line 293. Use of uninitialized value in subroutine entry at /usr/local/share/perl/5.8.4/POE/Component/Jabber/Client/J2.pm line 294. Connected to MySQL database (bandersnatch@localhost) ... Bandersnatch is listening! ;)
Please post comments / discussion in this threadw