Integrating Tigase server with Drupal
Submitted by kobit on Tue, 2010-04-06 21:16
Tigase supports integration with Drupal on many levels. At the moment all stuff described below work with Drupal version 4.x and 5.x. They may also work with Drupal 6.x but this version hasn't been tested.
First of all it can authenticate users against Drupal database which means you have the same user account for both Drupal website and XMPP (Jabber) server. More over in such a configuration all account management is done via Drupal web interface like account creation, password change update user details and so on. Administrator can temporarily disable user account and this is respected by the Tigase server too.
Connecting to Drupal database
The best way to setup Tigase with Drupal database is via configuration wizards that isinit.properties file where you can put initial setting for Tigase configuration.
If you look in etc/ directory of your Tigase installation you should find a few files there. The one we want to base our configuration on is: init-mysql.properties. In some older packages the file might be missing, then you can download it from the SVN repository.
If you look inside the file and strip all the comments you would see following lines:
config-type=--gen-config-def --admins=admin@tigase.org,admin@tigase.net --user-db=mysql --user-db-uri=jdbc:mysql://localhost/tigasedb?user=tigase_user&password=mypass --virt-hosts=tigase.org,tigase.net --debug=serverAll you need to connect to Drupal database are 2 following lines:
--auth-db=drupal --auth-db-uri=jdbc:mysql://localhost/drupal?user=drupalusr&password=drupalpassLet's combine it in a single file called
etc/init-drupal.properties:
config-type=--gen-config-def --admins=admin@tigase.org,admin@tigase.net --auth-db=drupal --auth-db-uri=jdbc:mysql://localhost/drupal?user=drupalusr&password=drupalpass --user-db=mysql --user-db-uri=jdbc:mysql://localhost/tigasedb?user=tigase_user&password=mypass --virt-hosts=tigase.org,tigase.net --debug=serverIn theory you can load Tigase database schema to Drupal database and then both
db-uris would have the same database connection string. More details about setting up and connecting to MySQL database can be found in the guide.
You need also to edit etc/tigase.conf file to point to your newly created properties file. The last line which looks like this:
TIGASE_OPTIONS=" --property-file etc/init.properties "should be changed to following:
TIGASE_OPTIONS=" --property-file etc/init-drupal.properties "Make sure you have Java-6 installed and
JAVA_HOME is set to correct location. If JAVA_HOME is not set you can add following line to etc/tigase.conf file:
JAVA_HOME="/your/java-6-location"The best way to check whether the variable is set correctly is with command:
$ ls -l $JAVA_HOME/bin/javashould list you the file without error. Check also if
logs/ directory is created in your Tigase server location as sometimes unpacking application doesn't create empty directories.
Now when you have the configuration file and databases ready to use you can start the Tigase server with the following command:
./bin/tigase.sh start etc/tigase.confIf you run the Tigase server installed from sources the command would be:
./scripts/tigase.sh start etc/tigase.confThere are system startup scripts for Gentoo and Mandriva Linux on
bin/ or scripts/ directory which can be used to automatically start the server when system starts.
Now you can register an account on your Drupal website and connect with Jabber client using the account details.
Note! You have to enable plain password authentication in your Jabber client to connect to the Tigase server with Drupal database
- Add new comment
- 5523 reads






Recent comments
29 min 24 sec ago
3 hours 6 min ago
5 hours 12 min ago
5 hours 14 min ago
5 hours 35 min ago
8 hours 48 min ago
8 hours 53 min ago
1 day 21 min ago
1 day 5 hours ago
1 day 6 hours ago