Difference between revisions of "Funambol"

From SME Server
Jump to navigationJump to search
 
(65 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Needs review}}
 
{{Needs review}}
{{Note box|This HOWTO is still under development.}}
 
 
{{Level|Advanced}}
 
{{Level|Advanced}}
 
== Introduction ==  
 
== Introduction ==  
 +
The Funambol middleware allows you to synchronize mobile devices with [http://wiki.contribs.org/Sogo SOGo] through the
 +
use of the Funambol [http://wiki.contribs.org/Sogo SOGo] Connector. The connector allows any SyncML enabled devices to
 +
fully synchronize contacts, events and tasks with [http://wiki.contribs.org/Sogo SOGo].
  
This is a very preliminary writeup on the installation of Funambol on an SME8b5 installation for use with [[Sogo]]
+
This HOWTO describes the installation procedure for installing Funambol with the [http://wiki.contribs.org/Sogo SOGo] Connector on an SME8b5 installation.
 
 
Use only for testing on non production machines and when you find an error, please correct it right here :-)
 
  
 
== Download & Install Funambol ==
 
== Download & Install Funambol ==
 
 
Goto https://www.forge.funambol.org/DomainHome.html
 
Goto https://www.forge.funambol.org/DomainHome.html
to download Funambol 8.0. The latest GNU/Linux 32bit funambol server is 8.5, but this has not been confirmed yet for use with SOGO.
+
to download Funambol 8.5. The latest GNU/Linux 32bit funambol server is 8.7, but this has not been confirmed yet for use with SOGO.
  
cd /opt
+
  wget http://download.forge.objectweb.org/sync4j/funambol-8.5.2.bin
  wget http://download.forge.objectweb.org/sync4j/funambol-8.0.2.bin
 
  
 
Run the binary to install:
 
Run the binary to install:
  
  chmod +x funambol-8.0.2.bin
+
  chmod +x funambol-8.5.2.bin
  ./funambol-8.0.2.bin
+
  ./funambol-8.5.2.bin
  
Agree on the licence terms and accept ''/opt'' as the directory to extract Funambol. This will install it in:
+
Agree on the licence terms and accept '''/opt''' as the directory to extract Funambol. This will install it in:
  
 
  /opt/Funambol
 
  /opt/Funambol
Line 27: Line 25:
 
At the end of the install, answer '''NO''' on the question if you want to start the server.
 
At the end of the install, answer '''NO''' on the question if you want to start the server.
  
== Download Apache Commons components ==
+
== Setup Funambol to use MySQL ==
Download components from here
+
 
 +
=== Download & Configure MySQL JDBC driver ===
 +
Funambol by installation defaults to use the Hypersonic DB engine, but [http://wiki.contribs.org/Sogo SOGo] uses MySQL and for Funambol to access the [http://wiki.contribs.org/Sogo SOGo] databases it needs to be setup to also use MySQL for the Funambol database.
 +
 
 +
Goto http://dev.mysql.com/downloads/connector/j/5.0.html to download the JDBC driver for MySQL. The current version is '''mysql-connector-java-5.0.8.zip'''.
 +
 
 +
unzip mysql-connector-java-5.0.8.zip
 +
mkdir -p /opt/Funambol/tools/mysql/lib
 +
cp mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar /opt/Funambol/tools/mysql/lib
 +
rm -rf mysql-connector-java-5.0.8
 +
 
 +
Edit the '''/opt/Funambol/ds-server/install.properties''' file to change the Funambol DB connector to MySQL.
 +
 
 +
vim /opt/Funambol/ds-server/install.properties
 +
 
 +
Change the line with '''dbms=''' to:
 +
 
 +
# The DBMS name. One of:
 +
#  - hypersonic
 +
#  - postgresql
 +
#  - mysql
 +
#
 +
dbms=mysql
 +
 
 +
Comment out the  existing jdbc driver for Hypersonic and add the MySQL connection information:
 +
 
 +
# MySQL
 +
# =====
 +
jdbc.classpath=../tools/mysql/lib/mysql-connector-java-5.0.8-bin.jar
 +
jdbc.driver=com.mysql.jdbc.Driver
 +
jdbc.url=jdbc:mysql://localhost/funambol?characterEncoding=UTF-8
 +
jdbc.user=funambol
 +
jdbc.password=yourpassword
 +
 
 +
=== Reconfigure MySQL for InnoDB and access from the local network ===
 +
Funambol uses MySQL with the InnoDB engine and uses networking for access.
 +
 
 +
/sbin/e-smith/config setprop mysqld InnoDB enabled
 +
/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
 +
/sbin/e-smith/expand-template /etc/my.cnf
 +
/etc/rc.d/rc7.d/S50mysqld restart
 +
 
 +
=== Creating MYSQL user and database ===
 +
To create the Funambol Database, you'll need to perform each of the following steps:
 +
mysqladmin create funambol --default-character-set=utf8
 +
mysql -e "grant all privileges on funambol.* to funambol@localhost identified by 'yourpassword'"
 +
mysql -e "flush privileges"
 +
{{Warning box|You may wish to alter the "funambol" and "yourpassword" information in the grant privileges line above. Be sure to configure it correctly in '''/opt/Funambol/ds-server/install.properties''' !}}
 +
 
 +
== Disable Hypersonic JDBC driver ==
 +
Edit '''/opt/Funambol/bin/funambol''' and change '''COMED=true''' to '''COMED=false''' somewhere around line 44.
 +
 
 +
This prevents the start/stop script from trying to start or stop the Hypersonic database, since we’re are now using MySQL.
 +
 
 +
Optionally you can ''rm -rf /opt/Funambol/tools/hypersonic'' to save a bit of disk space.
 +
 
 +
== Create Funambol user and group ==
 +
groupadd funambol
 +
useradd -g funambol -d /opt/Funambol funambol
 +
chmod 770 /opt/Funambol/
 +
 
 +
== Set Funambol to start on system startup ==
 +
To make Funambol start automagically, create
 +
 
 +
vim /etc/init.d/funambol
 +
 
 +
with the following content:
 +
 
 +
#! /bin/bash
 +
#
 +
# funambol Start the funambol services
 +
#
 +
NAME="Funambol 8.0 with SOGO Connector"
 +
FUNAMBOL_HOME=/opt/Funambol/bin
 +
FUNAMBOL_USER=funambol
 +
case "$1" in
 +
  start)
 +
    echo -ne "Starting $NAME.\n"
 +
    cd $FUNAMBOL_HOME
 +
    /bin/su $FUNAMBOL_USER funambol start
 +
    ;;
 +
  stop)
 +
    echo -ne "Stopping $NAME.\n"
 +
    cd $FUNAMBOL_HOME
 +
    /bin/su $FUNAMBOL_USER funambol stop
 +
    ;;
 +
  *)
 +
    echo "Usage: /etc/init.d/funambol {start|stop}"
 +
    exit 1
 +
    ;;
 +
esac
 +
exit 0
 +
 
 +
complete it with:
 +
 
 +
chmod 755 /etc/init.d/funambol
 +
ln -s /etc/init.d/funambol /etc/rc.d/rc7.d/S98funambol
 +
ln -s /etc/init.d/funambol /etc/rc.d/rc6.d/K02funambol
 +
ln -s /etc/init.d/funambol /etc/rc.d/rc2.d/K02funambol
 +
ln -s /etc/init.d/funambol /etc/rc.d/rc1.d/K02funambol
 +
ln -s /etc/init.d/funambol /etc/rc.d/rc0.d/K02funambol
 +
 
 +
== Add the SOGo Connector ==
 +
''At this stage the core Funambol installation is complete with the exception of the creation of the Funambol database tables. The sections below add the [http://wiki.contribs.org/Sogo SOGo] parts before doing so.''
 +
 
 +
=== Apache Commons Components ===
 +
The Funambol [http://wiki.contribs.org/Sogo SOGo] Connector requires Apache commons collections (v3.2.1), confguration (v1.6), logging (v1.1), lang (v2.4) and the JSON.simple package. The following subsections have the command required to download and insert the .jar files into the Funambol installation.
 +
 
 +
These components can be downloaded from here:
  
 
  http://commons.apache.org/
 
  http://commons.apache.org/
  
Copy components in the following directory
+
and are copied into the following directory
  
 
  cd /opt/Funambol/tools/tomcat/lib/
 
  cd /opt/Funambol/tools/tomcat/lib/
  
=== collections (v3.2.1) ===
+
==== collections (v3.2.1) ====
 
  wget http://www.apache.org/dist/commons/collections/binaries/commons-collections-3.2.1-bin.zip
 
  wget http://www.apache.org/dist/commons/collections/binaries/commons-collections-3.2.1-bin.zip
 
  unzip commons-collections-3.2.1-bin.zip
 
  unzip commons-collections-3.2.1-bin.zip
Line 42: Line 148:
 
  rm -rf commons-collections-3.2.1
 
  rm -rf commons-collections-3.2.1
  
=== confguration (v1.6) ===
+
==== confguration (v1.6) ====
 
  wget http://www.apache.org/dist/commons/configuration/binaries/commons-configuration-1.6.zip
 
  wget http://www.apache.org/dist/commons/configuration/binaries/commons-configuration-1.6.zip
 
  unzip commons-configuration-1.6.zip
 
  unzip commons-configuration-1.6.zip
Line 48: Line 154:
 
  rm -rf  commons-configuration-1.6
 
  rm -rf  commons-configuration-1.6
  
=== logging (v1.1) ===
+
==== logging (v1.1) ====
 
  wget http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.1.1-bin.zip
 
  wget http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.1.1-bin.zip
 
  unzip commons-logging-1.1.1-bin.zip
 
  unzip commons-logging-1.1.1-bin.zip
Line 54: Line 160:
 
  rm -rf  commons-logging-1.1.1
 
  rm -rf  commons-logging-1.1.1
  
=== lang (v2.4) ===
+
==== lang (v2.4) ====
 
  wget http://www.apache.org/dist/commons/lang/binaries/commons-lang-2.5-bin.zip
 
  wget http://www.apache.org/dist/commons/lang/binaries/commons-lang-2.5-bin.zip
 
  unzip commons-lang-2.5-bin.zip
 
  unzip commons-lang-2.5-bin.zip
Line 60: Line 166:
 
  rm -rf commons-lang-2.5
 
  rm -rf commons-lang-2.5
  
=== json-simple ===
+
==== json-simple ====
cd /opt/Funambol/tools/tomcat/lib/
 
 
  wget http://json-simple.googlecode.com/files/json_simple.jar
 
  wget http://json-simple.googlecode.com/files/json_simple.jar
 +
cp json_simple.jar /opt/Funambol/tools/tomcat/lib/
  
== Install Funambol SOGO Connector ==
+
=== Download & Configure Funambol [http://wiki.contribs.org/Sogo SOGo] Connector ===
Check here: http://www.scalableogo.org/english/downloads/backend.html for the latest version of the  
+
Check here: http://www.sogo.nu/english/downloads/backend.html for the latest version of the  
 
'''Funambol SOGo Connector'''
 
'''Funambol SOGo Connector'''
  
cd /opt/Funambol/ds-server/modules
+
  wget http://www.sogo.nu/uploads/Funambol/funambol-sogo-1.0.8.s4j
  wget http://www.scalableogo.org/uploads/Funambol/funambol-sogo-1.0.7.s4j
+
cp funambol-sogo-1.0.8.s4j /opt/Funambol/ds-server/modules
  
 
Then, open the '''/opt/Funambol/ds-server/install.properties''' file  
 
Then, open the '''/opt/Funambol/ds-server/install.properties''' file  
Line 75: Line 181:
 
  vim /opt/Funambol/ds-server/install.properties
 
  vim /opt/Funambol/ds-server/install.properties
  
and add '''funambol-sogo-1.0.7''' at the end of the "modules-to-install" line.
+
and add '''funambol-sogo-1.0.8''' at the end of the "modules-to-install" line.
  
== Install MySQL JDBC driver ==
+
== Install Modules and Create Funambol Database Tables ==
Funambol by installation defaults to use the Hypersonic DB engine, but SOGO requires the use of MySQL.
 
  
Goto http://dev.mysql.com/downloads/connector/j/5.0.html to download the JDBC driver for MySQL. The current version is '''mysql-connector-java-5.0.8.zip'''. Download it to '''/opt'''.
+
With Funambol ready to go and the SOGo modules in place, Funambol needs to be configured and the database tables created by issuing the following commands :
  
  cd /opt
+
  cd /opt/Funambol/
unzip mysql-connector-java-5.0.8.zip
+
  ./bin/install
mkdir -p /opt/Funambol/tools/mysql/lib
 
  cp mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar /opt/Funambol/tools/mysql/lib
 
rm -rf mysql-connector-java-5.0.8
 
  
Edit the '''/opt/Funambol/ds-server/install.properties''' file to change the Funambol DB connector to MySQL.
+
Answer 'yes' to all questions.
  
vim /opt/Funambol/ds-server/install.properties
+
Once complete, update file ownerships for all files in the '''/opt/Funambol''' tree (''the install creates a couple of configuration and log files in the /opt/Funambiol tree''):
  
Comment out the existing jdbc driver for Hypersonic and add:
+
  chown -R funambol:funambol /opt/Funambol/
  
# MySQL
+
Funambol is now installed. Start the Funambol server as the '''funambol''' user using:
# =====
 
jdbc.classpath=../tools/mysql/lib/mysql-connector-java-5.0.8-bin.jar
 
jdbc.driver=com.mysql.jdbc.Driver
 
jdbc.url=jdbc:mysql://localhost:3306/funambol?characterEncoding=UTF-8
 
jdbc.user=funambol
 
jdbc.password=yourpassword
 
  
== Creating MYSQL user and database ==
+
/etc/init.d/funambol start
  
To create the Funambol Database, you'll need to perform each of the following steps:
+
== Verify Funambol Installation ==
  
mysqladmin create funambol --default-character-set=utf8
+
Have a quick look if Funambol is running correctly by accessing the web page on:
mysql -e "grant all privileges on funambol.* to funambol@localhost identified by 'yourpassword'"
 
mysql -e "flush privileges"
 
  
{{Warning box|You may wish to alter the "funambol" and "yourpassword" information in the grant privileges line above. Be sure to configure it correctly in '''/opt/Funambol/ds-server/install.properties''' !}}
+
http://<server_domain_name>:8080/funambol/ds
  
== Reconfigure MySQL for InnoDB and access from the local network ==
+
if the server is running, a web page with Funambol Data Synchronization Service information will appear.
  
Funambol uses MySQL wit the InnoDB engine.
+
== Change Funambol Admin Password ==
  
Access to port 3306 needs to be validated.
+
The default Funambol admin password is '''sa'''. This can be changed with the '''admin-passwd''' utility but it needs a small fix to load the MySQL connector correctly.
  
/sbin/e-smith/config setprop mysqld InnoDB enabled
+
Edit '''/opt/Funambol/bin/admin-passwd'''
/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
 
/sbin/e-smith/expand-template /etc/my.cnf
 
/etc/rc.d/rc7.d/S50mysqld restart
 
  
== Disable Hypersonic JDBC driver ==
+
vim /opt/Funambol/bin/admin-passwd
 +
 +
and change the line with '''JDBC_JAR''' near the top of the file to:
  
Edit '''/opt/Funambol/bin/funambol''' and change '''COMED=true''' to '''COMED=false''' somewhere around line 44.
+
JDBC_JAR=/opt/Funambol/tools/mysql/lib/mysql-connector-java-5.0.8-bin.jar
 
 
This prevents the start/stop script from trying to start or stop the Hypersonic database, since we’re are now using MySQL.
 
  
Optionally you can ''rm -rf /opt/Funambol/tools/hypersonic'' to save a bit of disk space.
+
Save and run:
  
== Install Modules in Funambol ==
+
cd /opt/Funambol
Start the Funambol server using:
+
./bin/admin-passwd
  
/opt/Funambol/bin/funambol start
+
and follow the prompts.
  
Next, install the Funambol SOGo Connector within Funambol server by issuing the following commands :
+
== Public Access to Funambol ==
 +
And if you want to access Funambol outside your local network, you must open port 8080:
  
  cd /opt/Funambol/
+
  config set funambol service access public status enabled TCPPort 8080
  ./bin/install
+
  signal-event remoteaccess-update
  
Answer 'yes' to all questions.
+
{{Warning box|Port 8080 may conflict with other software installations!}}
 +
{{Note box|TODO: work out where the Funambol port is configured and template it for easy change.}}
 +
{{Note box|TODO: setup apache to proxy the funambol port.}}
  
See also:
+
== Create SOGo Sync Sources ==
 +
The SOGo-Funambol documentation describes how to create the '''sogo-cal''', '''sogo-card''' and '''sogo-todo''' sync sources through the Funambol administration tool. There are Windows versions of this tool that can be run from a PC and connect to the Funambol server we just installed.
  
[https://core.forge.funambol.org/wiki/HOWTOFunambolMySQLFedora10 https://core.forge.funambol.org/wiki/HOWTOFunambolMySQLFedora10]
+
However, the commands below emulate this process and creates entries in the funambol database and the sections below create templated versions of the required XML files, as this allows the [http://wiki.contribs.org/Sogo SOGo] database password to be inserted into these XML files.
  
== Auto start Funambol on startup ==
+
The section below inserts the required entries into the funambol database. The next sections create and expand the template files as needed to complete the configuration for [http://wiki.contribs.org/Sogo SOGo].
  
To make Funambol start automagically, create
+
=== Create Funambol Database Sync Source Entries ===
 +
Create a temporary SQL file:
  
  vim /etc/init.d/funambol
+
  vim sogo-sync-source-insert.sql
  
with the following content:
+
and insert:
  
  #! /bin/bash
+
  INSERT INTO `fnbl_sync_source` (`uri`, `config`, `name`, `sourcetype`) VALUES
  #
+
  ('sogo-cal', 'sogo/sogo/sogo/sogo-cal.xml', 'sogo-cal', 'sogo'),
# funambol Start the funambol services
+
  ('sogo-card', 'sogo/sogo/sogo/sogo-card.xml', 'sogo-card', 'sogo'),
#
+
('sogo-todo', 'sogo/sogo/sogo/sogo-todo.xml', 'sogo-todo', 'sogo');
NAME="funambol"
 
FUNAMBOL_HOME=/opt/Funambol/bin
 
FUNAMBOL_USER=root
 
  case "$1" in
 
  start)
 
    echo -ne "Starting $NAME.\n"
 
    cd $FUNAMBOL_HOME
 
    /bin/su $FUNAMBOL_USER funambol start
 
    ;;
 
  stop)
 
    echo -ne "Stopping $NAME.\n"
 
    cd $FUNAMBOL_HOME
 
    /bin/su $FUNAMBOL_USER funambol stop
 
    ;;
 
  *)
 
    echo "Usage: /etc/init.d/funambol {start|stop}"
 
    exit 1
 
    ;;
 
esac
 
exit 0
 
  
complete with
+
save the file and then insert the SQL into the funambol database:
  
  chmod 755 /etc/init.d/funambol
+
  mysql funambol --user=funambol --password=yourpassword < sogo-sync-source-insert.sql
  
== Configuring the Calendar Sync connection ==
+
=== Configuring the Calendar Sync connection ===
 +
mkdir -p /opt/Funambol/config/sogo/sogo/sogo
 
  mkdir -p /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-cal.xml
 
  mkdir -p /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-cal.xml
 
  cd /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-cal.xml
 
  cd /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-cal.xml
 
  touch template-begin
 
  touch template-begin
 +
 +
Edit a new file with:
 +
 
  vim sogo-cal.xml
 
  vim sogo-cal.xml
expand-template /opt/Funambol/config/sogo/sogo/sogo/sogo-cal.xml
+
 
 
+
And insert the following. Note the ''$sogod{'DbPassword'}'' in the scripts below. This pulls in the the database password that SOGO uses to access the MySQL database.
Note the ''$sogod{'DbPassword'}'' in the scripts below. This pulls in the the database password that SOGO uses to access the MySQL database.
 
  
 
  <nowiki><?xml version="1.0" encoding="UTF-8"?></nowiki>
 
  <nowiki><?xml version="1.0" encoding="UTF-8"?></nowiki>
Line 232: Line 311:
 
  <nowiki></java></nowiki>
 
  <nowiki></java></nowiki>
  
== Configuring the Address Book Sync connection ==
+
And don't forget to:
 +
 
 +
expand-template /opt/Funambol/config/sogo/sogo/sogo/sogo-cal.xml
 +
 
 +
=== Configuring the Address Book Sync connection ===
 
  mkdir -p /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-card.xml
 
  mkdir -p /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-card.xml
 
  cd /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-card.xml
 
  cd /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-card.xml
 
  touch template-begin
 
  touch template-begin
 
  vim sogo-card.xml
 
  vim sogo-card.xml
  expand-template /opt/Funambol/config/sogo/sogo/sogo/sogo-card.xml
+
   
 
+
Insert the following:
  
 
  <nowiki><?xml version="1.0" encoding="UTF-8"?></nowiki>
 
  <nowiki><?xml version="1.0" encoding="UTF-8"?></nowiki>
Line 279: Line 362:
 
  <nowiki></java></nowiki>
 
  <nowiki></java></nowiki>
  
== Configuring the Todo List Sync connection ==
+
And
 +
 
 +
expand-template /opt/Funambol/config/sogo/sogo/sogo/sogo-card.xml
 +
 
 +
=== Configuring the Todo List Sync connection ===
 
  mkdir -p /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-todo.xml
 
  mkdir -p /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-todo.xml
 
  cd /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-todo.xml
 
  cd /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-todo.xml
 
  touch template-begin
 
  touch template-begin
 
  vim sogo-todo.xml
 
  vim sogo-todo.xml
expand-template /opt/Funambol/config/sogo/sogo/sogo/sogo-todo.xml
 
  
 +
Insert the following:
  
 
  <nowiki><?xml version="1.0" encoding="UTF-8"?></nowiki>
 
  <nowiki><?xml version="1.0" encoding="UTF-8"?></nowiki>
Line 326: Line 413:
 
  <nowiki></java></nowiki>
 
  <nowiki></java></nowiki>
  
 +
And
 +
 +
expand-template /opt/Funambol/config/sogo/sogo/sogo/sogo-todo.xml
  
 
== Auto-create Funambol user accounts ==
 
== Auto-create Funambol user accounts ==
Line 331: Line 421:
  
 
  vim /opt/Funambol/config/Funambol.xml
 
  vim /opt/Funambol/config/Funambol.xml
 
  
 
And change the officer parameter:
 
And change the officer parameter:
Line 338: Line 427:
 
       <nowiki><string>ca/inverse/sogo/security/SOGoOfficer.xml</string></nowiki>
 
       <nowiki><string>ca/inverse/sogo/security/SOGoOfficer.xml</string></nowiki>
 
     <nowiki></void></nowiki>
 
     <nowiki></void></nowiki>
 
  
 
Then create the SOGoOfficer.xml file
 
Then create the SOGoOfficer.xml file
Line 344: Line 432:
 
  vim /opt/Funambol/config/ca/inverse/sogo/security/SOGoOfficer.xml
 
  vim /opt/Funambol/config/ca/inverse/sogo/security/SOGoOfficer.xml
  
 +
and insert or update to:
  
 
  <nowiki><?xml version="1.0" encoding="UTF-8"?></nowiki>
 
  <nowiki><?xml version="1.0" encoding="UTF-8"?></nowiki>
Line 356: Line 445:
 
   <nowiki></object></nowiki>
 
   <nowiki></object></nowiki>
 
  <nowiki></java></nowiki>
 
  <nowiki></java></nowiki>
 +
 +
== Cleanup and Restart ==
 +
 +
Once complete, update file ownerships for all files again in the '''/opt/Funambol''' tree
 +
 +
chown -R funambol:funambol /opt/Funambol/
 +
 +
Stop and Start the Funambol server as the '''funambol''' user using:
 +
 +
/etc/init.d/funambol stop
 +
/etc/init.d/funambol start
  
 
== Funambol Client Configuration ==
 
== Funambol Client Configuration ==
  
The URL for accessing the Funambol server is:
+
The URL for accessing the Funambol server from mobile devices is:
  
 
   http://<server_domain_name>:8080/funambol/ds
 
   http://<server_domain_name>:8080/funambol/ds
Line 369: Line 469:
 
* Tasks:    sogo-todo
 
* Tasks:    sogo-todo
  
To connect to the generic Funambol sync items use:
+
== References ==
 
+
* Funambol Documentation: https://www.forge.funambol.org/download/documentation.html
* Contacts: card
+
* SOGo Documentation: http://www.sogo.nu/english/downloads/documentation.html
* Calendar: event
 
* Tasks:   task
 
 
 
 
 
 
 
  
 
----
 
----
 
[[Category: Howto]]
 
[[Category: Howto]]

Latest revision as of 00:53, 10 November 2010

Edit-find-replace.png Not reviewed:
This howto or contrib has not been reviewed and might contain code that could harm your installation. For more information on the review process have a look at the Development Review page.


PythonIcon.png Skill level: Advanced
The instructions on this page may require deviations from standard procedures. A good understanding of linux and Koozali SME Server is recommended.


Introduction

The Funambol middleware allows you to synchronize mobile devices with SOGo through the use of the Funambol SOGo Connector. The connector allows any SyncML enabled devices to fully synchronize contacts, events and tasks with SOGo.

This HOWTO describes the installation procedure for installing Funambol with the SOGo Connector on an SME8b5 installation.

Download & Install Funambol

Goto https://www.forge.funambol.org/DomainHome.html to download Funambol 8.5. The latest GNU/Linux 32bit funambol server is 8.7, but this has not been confirmed yet for use with SOGO.

wget http://download.forge.objectweb.org/sync4j/funambol-8.5.2.bin

Run the binary to install:

chmod +x funambol-8.5.2.bin
./funambol-8.5.2.bin

Agree on the licence terms and accept /opt as the directory to extract Funambol. This will install it in:

/opt/Funambol

At the end of the install, answer NO on the question if you want to start the server.

Setup Funambol to use MySQL

Download & Configure MySQL JDBC driver

Funambol by installation defaults to use the Hypersonic DB engine, but SOGo uses MySQL and for Funambol to access the SOGo databases it needs to be setup to also use MySQL for the Funambol database.

Goto http://dev.mysql.com/downloads/connector/j/5.0.html to download the JDBC driver for MySQL. The current version is mysql-connector-java-5.0.8.zip.

unzip mysql-connector-java-5.0.8.zip
mkdir -p /opt/Funambol/tools/mysql/lib
cp mysql-connector-java-5.0.8/mysql-connector-java-5.0.8-bin.jar /opt/Funambol/tools/mysql/lib
rm -rf mysql-connector-java-5.0.8

Edit the /opt/Funambol/ds-server/install.properties file to change the Funambol DB connector to MySQL.

vim /opt/Funambol/ds-server/install.properties

Change the line with dbms= to:

# The DBMS name. One of:
#   - hypersonic
#   - postgresql
#   - mysql
#
dbms=mysql

Comment out the existing jdbc driver for Hypersonic and add the MySQL connection information:

# MySQL
# =====
jdbc.classpath=../tools/mysql/lib/mysql-connector-java-5.0.8-bin.jar
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost/funambol?characterEncoding=UTF-8
jdbc.user=funambol
jdbc.password=yourpassword

Reconfigure MySQL for InnoDB and access from the local network

Funambol uses MySQL with the InnoDB engine and uses networking for access.

/sbin/e-smith/config setprop mysqld InnoDB enabled
/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
/sbin/e-smith/expand-template /etc/my.cnf
/etc/rc.d/rc7.d/S50mysqld restart

Creating MYSQL user and database

To create the Funambol Database, you'll need to perform each of the following steps:

mysqladmin create funambol --default-character-set=utf8
mysql -e "grant all privileges on funambol.* to funambol@localhost identified by 'yourpassword'"
mysql -e "flush privileges"
Warning.png Warning:
You may wish to alter the "funambol" and "yourpassword" information in the grant privileges line above. Be sure to configure it correctly in /opt/Funambol/ds-server/install.properties !


Disable Hypersonic JDBC driver

Edit /opt/Funambol/bin/funambol and change COMED=true to COMED=false somewhere around line 44.

This prevents the start/stop script from trying to start or stop the Hypersonic database, since we’re are now using MySQL.

Optionally you can rm -rf /opt/Funambol/tools/hypersonic to save a bit of disk space.

Create Funambol user and group

groupadd funambol
useradd -g funambol -d /opt/Funambol funambol
chmod 770 /opt/Funambol/

Set Funambol to start on system startup

To make Funambol start automagically, create

vim /etc/init.d/funambol

with the following content:

#! /bin/bash
#
# funambol Start the funambol services
#
NAME="Funambol 8.0 with SOGO Connector"
FUNAMBOL_HOME=/opt/Funambol/bin
FUNAMBOL_USER=funambol
case "$1" in
  start)
    echo -ne "Starting $NAME.\n"
    cd $FUNAMBOL_HOME
    /bin/su $FUNAMBOL_USER funambol start
    ;;
  stop)
    echo -ne "Stopping $NAME.\n"
    cd $FUNAMBOL_HOME
    /bin/su $FUNAMBOL_USER funambol stop
    ;;
  *)
    echo "Usage: /etc/init.d/funambol {start|stop}"
    exit 1
    ;;
esac
exit 0

complete it with:

chmod 755 /etc/init.d/funambol
ln -s /etc/init.d/funambol /etc/rc.d/rc7.d/S98funambol
ln -s /etc/init.d/funambol /etc/rc.d/rc6.d/K02funambol
ln -s /etc/init.d/funambol /etc/rc.d/rc2.d/K02funambol
ln -s /etc/init.d/funambol /etc/rc.d/rc1.d/K02funambol
ln -s /etc/init.d/funambol /etc/rc.d/rc0.d/K02funambol

Add the SOGo Connector

At this stage the core Funambol installation is complete with the exception of the creation of the Funambol database tables. The sections below add the SOGo parts before doing so.

Apache Commons Components

The Funambol SOGo Connector requires Apache commons collections (v3.2.1), confguration (v1.6), logging (v1.1), lang (v2.4) and the JSON.simple package. The following subsections have the command required to download and insert the .jar files into the Funambol installation.

These components can be downloaded from here:

http://commons.apache.org/

and are copied into the following directory

cd /opt/Funambol/tools/tomcat/lib/

collections (v3.2.1)

wget http://www.apache.org/dist/commons/collections/binaries/commons-collections-3.2.1-bin.zip
unzip commons-collections-3.2.1-bin.zip
cp -p commons-collections-3.2.1/commons-collections-3.2.1.jar /opt/Funambol/tools/tomcat/lib/
rm -rf commons-collections-3.2.1

confguration (v1.6)

wget http://www.apache.org/dist/commons/configuration/binaries/commons-configuration-1.6.zip
unzip commons-configuration-1.6.zip
cp -p commons-configuration-1.6/commons-configuration-1.6.jar /opt/Funambol/tools/tomcat/lib/
rm -rf  commons-configuration-1.6

logging (v1.1)

wget http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.1.1-bin.zip
unzip commons-logging-1.1.1-bin.zip
cp -p commons-logging-1.1.1/commons-logging-1.1.1.jar /opt/Funambol/tools/tomcat/lib/
rm -rf  commons-logging-1.1.1

lang (v2.4)

wget http://www.apache.org/dist/commons/lang/binaries/commons-lang-2.5-bin.zip
unzip commons-lang-2.5-bin.zip
cp -p commons-lang-2.5/commons-lang-2.5.jar /opt/Funambol/tools/tomcat/lib/
rm -rf commons-lang-2.5

json-simple

wget http://json-simple.googlecode.com/files/json_simple.jar
cp json_simple.jar /opt/Funambol/tools/tomcat/lib/

Download & Configure Funambol SOGo Connector

Check here: http://www.sogo.nu/english/downloads/backend.html for the latest version of the Funambol SOGo Connector

wget http://www.sogo.nu/uploads/Funambol/funambol-sogo-1.0.8.s4j
cp funambol-sogo-1.0.8.s4j /opt/Funambol/ds-server/modules

Then, open the /opt/Funambol/ds-server/install.properties file

vim /opt/Funambol/ds-server/install.properties

and add funambol-sogo-1.0.8 at the end of the "modules-to-install" line.

Install Modules and Create Funambol Database Tables

With Funambol ready to go and the SOGo modules in place, Funambol needs to be configured and the database tables created by issuing the following commands :

cd /opt/Funambol/
./bin/install

Answer 'yes' to all questions.

Once complete, update file ownerships for all files in the /opt/Funambol tree (the install creates a couple of configuration and log files in the /opt/Funambiol tree):

chown -R funambol:funambol /opt/Funambol/

Funambol is now installed. Start the Funambol server as the funambol user using:

/etc/init.d/funambol start

Verify Funambol Installation

Have a quick look if Funambol is running correctly by accessing the web page on:

http://<server_domain_name>:8080/funambol/ds

if the server is running, a web page with Funambol Data Synchronization Service information will appear.

Change Funambol Admin Password

The default Funambol admin password is sa. This can be changed with the admin-passwd utility but it needs a small fix to load the MySQL connector correctly.

Edit /opt/Funambol/bin/admin-passwd

vim /opt/Funambol/bin/admin-passwd

and change the line with JDBC_JAR near the top of the file to:

JDBC_JAR=/opt/Funambol/tools/mysql/lib/mysql-connector-java-5.0.8-bin.jar

Save and run:

cd /opt/Funambol
./bin/admin-passwd

and follow the prompts.

Public Access to Funambol

And if you want to access Funambol outside your local network, you must open port 8080:

config set funambol service access public status enabled TCPPort 8080
signal-event remoteaccess-update


Warning.png Warning:
Port 8080 may conflict with other software installations!


Important.png Note:
TODO: work out where the Funambol port is configured and template it for easy change.


Important.png Note:
TODO: setup apache to proxy the funambol port.


Create SOGo Sync Sources

The SOGo-Funambol documentation describes how to create the sogo-cal, sogo-card and sogo-todo sync sources through the Funambol administration tool. There are Windows versions of this tool that can be run from a PC and connect to the Funambol server we just installed.

However, the commands below emulate this process and creates entries in the funambol database and the sections below create templated versions of the required XML files, as this allows the SOGo database password to be inserted into these XML files.

The section below inserts the required entries into the funambol database. The next sections create and expand the template files as needed to complete the configuration for SOGo.

Create Funambol Database Sync Source Entries

Create a temporary SQL file:

vim sogo-sync-source-insert.sql

and insert:

INSERT INTO `fnbl_sync_source` (`uri`, `config`, `name`, `sourcetype`) VALUES
('sogo-cal', 'sogo/sogo/sogo/sogo-cal.xml', 'sogo-cal', 'sogo'),
('sogo-card', 'sogo/sogo/sogo/sogo-card.xml', 'sogo-card', 'sogo'),
('sogo-todo', 'sogo/sogo/sogo/sogo-todo.xml', 'sogo-todo', 'sogo');

save the file and then insert the SQL into the funambol database:

mysql funambol --user=funambol --password=yourpassword < sogo-sync-source-insert.sql

Configuring the Calendar Sync connection

mkdir -p /opt/Funambol/config/sogo/sogo/sogo
mkdir -p /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-cal.xml
cd /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-cal.xml
touch template-begin

Edit a new file with:

vim sogo-cal.xml
 

And insert the following. Note the $sogod{'DbPassword'} in the scripts below. This pulls in the the database password that SOGO uses to access the MySQL database.

<?xml version="1.0" encoding="UTF-8"?>
<java version="1.5.0_10" class="java.beans.XMLDecoder">
 <object class="ca.inverse.sogo.engine.source.SOGoSyncSource">
  <void property="databasePassword">
   <string>{$sogod{'DbPassword'}}</string>
  </void>
  <void property="databaseURL">
   <string>jdbc:mysql://localhost/sogo</string>
  </void>
  <void property="databaseUsername">
   <string>sogo</string>
  </void>
  <void property="info">
   <object class="com.funambol.framework.engine.source.SyncSourceInfo">
    <void property="supportedTypes">
     <array class="com.funambol.framework.engine.source.ContentType" length="1">
      <void index="0">
       <object class="com.funambol.framework.engine.source.ContentType">
        <void property="type">
         <string>text/x-vevent</string>
        </void>
        <void property="version">
         <string>1</string>
        </void>
       </object>
      </void>
     </array>
    </void>
   </object>
  </void>
  <void property="name">
   <string>sogo-cal</string>
  </void>
  <void property="sourceURI">
   <string>sogo-cal</string>
  </void>
 </object>
</java>

And don't forget to:

expand-template /opt/Funambol/config/sogo/sogo/sogo/sogo-cal.xml

Configuring the Address Book Sync connection

mkdir -p /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-card.xml
cd /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-card.xml
touch template-begin
vim sogo-card.xml

Insert the following:

<?xml version="1.0" encoding="UTF-8"?>
<java version="1.5.0_10" class="java.beans.XMLDecoder">
 <object class="ca.inverse.sogo.engine.source.SOGoSyncSource">
  <void property="databasePassword">
   <string>{$sogod{'DbPassword'}}</string>
  </void>
  <void property="databaseURL">
   <string>jdbc:mysql://localhost/sogo</string>
  </void>
  <void property="databaseUsername">
   <string>sogo</string>
  </void>
  <void property="info">
   <object class="com.funambol.framework.engine.source.SyncSourceInfo">
    <void property="supportedTypes">
     <array class="com.funambol.framework.engine.source.ContentType" length="1">
      <void index="0">
       <object class="com.funambol.framework.engine.source.ContentType">
        <void property="type">
         <string>text/x-vcard</string>
        </void>
        <void property="version">
         <string>1</string>
        </void>
       </object>
      </void>
     </array>
    </void>
   </object>
  </void>
  <void property="name">
   <string>sogo-card</string>
  </void>
  <void property="sourceURI">
   <string>sogo-card</string>
  </void>
 </object>
</java>

And

expand-template /opt/Funambol/config/sogo/sogo/sogo/sogo-card.xml

Configuring the Todo List Sync connection

mkdir -p /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-todo.xml
cd /etc/e-smith/templates/opt/Funambol/config/sogo/sogo/sogo/sogo-todo.xml
touch template-begin
vim sogo-todo.xml

Insert the following:

<?xml version="1.0" encoding="UTF-8"?>
<java version="1.5.0_10" class="java.beans.XMLDecoder">
 <object class="ca.inverse.sogo.engine.source.SOGoSyncSource">
  <void property="databasePassword">
   <string>{$sogod{'DbPassword'}}</string>
  </void>
  <void property="databaseURL">
   <string>jdbc:mysql://localhost/sogo</string>
  </void>
  <void property="databaseUsername">
   <string>sogo</string>
  </void>
  <void property="info">
   <object class="com.funambol.framework.engine.source.SyncSourceInfo">
    <void property="supportedTypes">
     <array class="com.funambol.framework.engine.source.ContentType" length="1">
      <void index="0">
       <object class="com.funambol.framework.engine.source.ContentType">
        <void property="type">
         <string>text/x-vtodo</string>
        </void>
        <void property="version">
         <string>1</string>
        </void>
       </object>
      </void>
     </array>
    </void>
   </object>
  </void>
  <void property="name">
   <string>sogo-todo</string>
  </void>
  <void property="sourceURI">
   <string>sogo-todo</string>
  </void>
 </object>
</java>

And

expand-template /opt/Funambol/config/sogo/sogo/sogo/sogo-todo.xml

Auto-create Funambol user accounts

Edit the Funambol config file

vim /opt/Funambol/config/Funambol.xml

And change the officer parameter:

    <void property="officer">
     <string>ca/inverse/sogo/security/SOGoOfficer.xml</string>
    </void>

Then create the SOGoOfficer.xml file

vim /opt/Funambol/config/ca/inverse/sogo/security/SOGoOfficer.xml

and insert or update to:

<?xml version="1.0" encoding="UTF-8"?>
<java version="1.4.0" class="java.beans.XMLDecoder">
  <object class="ca.inverse.sogo.security.SOGoOfficer">
    <void property="host">
      <string>localhost</string>
    </void>
    <void property="port">
      <string>20000</string>
    </void>
  </object>
</java>

Cleanup and Restart

Once complete, update file ownerships for all files again in the /opt/Funambol tree

chown -R funambol:funambol /opt/Funambol/

Stop and Start the Funambol server as the funambol user using:

/etc/init.d/funambol stop
/etc/init.d/funambol start

Funambol Client Configuration

The URL for accessing the Funambol server from mobile devices is:

 http://<server_domain_name>:8080/funambol/ds

To connect to the SOGO Funambol sync items use:

  • Contacts: sogo-card
  • Calendar: sogo-cal
  • Tasks: sogo-todo

References