Installing the Funambol bundled server under Ubuntu Server (AMD64) + MySQL + LigHTTPd

After being burned by ScheduleWorld’s policy of first luring you in for free and then beginning to try and charge money, I decided to install Funambol myself and be done with all those synchronization headaches. Turns out installing funambol isn’t quite that easy, so for everybody interested as well, here’s a little step-by-step guide. You will need some command line literacy though.

  1. Download funambol-7.1.1.bin (if, like in my case, you have a headless server, also download funambol-admin-7.1.0.tgz for your desktop/laptop)
  2. Install the bundle. I went for /usr/lib/funambol as an installation directory, the default is /opt/Funambol. It shouldn’t matter much. Installation is started by issuing sh funambol-7.1.1.bin while ssh‘d into the server. From now on, I’ll assume the Funambol bundle to be installed in /usr/lib/funambol (and not /usr/lib/funambol/Funambol!)
  3. If you don’t have it installed already, sudo aptitude install sun-java6-bin sun-java6-jre. This step isn’t theoretically necessary if you’re on a 32bit OS. Next, edit /usr/lib/funambol/bin/funambol to contain export JAVA_HOME="/usr/lib/jvm/java-6-sun" and export JRE_HOME=$JAVA_HOME at the top. Also change COMED=true to COMED=false somewhere around line 50 while you’re at it (this prevents the start/stop script from trying to start or stop the Hypersonic database, since we’re going to use MySQL). To save some space on the server, you can safely rm -rf /usr/lib/funambol/tools/jre-1.5.0. In order to keep track of things, I went into /usr/lib/funambol/tools and did ln -s /usr/lib/jvm/java-6-sun. Update: You might want to do ln -s /usr/lib/jvm/java-6-sun jre-1.6.0 instead – thanks for the hint, Rachael!
    Also see the outdated HOWTOInstallOn64bit article on the Funambol Wiki.
  4. Go to /usr/lib/jvm/java-6-sun/jre/lib/ext and download mysql-connector-java-5.1.7.tar.gz. The tar.gz should contain a file called mysql-connector-java-5.1.7-bin.jar which you have to put into the ext directory. All other contents of the tar.gz and the tar.gz itself can be deleted again. Now back into /usr/lib/funambol and there to edit ds-server/install.properties. Line 24 will have to be changed from dbms=hypersonic to dbms=mysql. Next, comment lines 63 through 67, uncomment lines 55 through 59 and make them fit to your needs. For me, they read as follows:


    jdbc.classpath=../tools/java-6-sun/jre/lib/ext/mysql-connector-java-5.1.7-bin.jar
    jdbc.driver=com.mysql.jdbc.Driver
    jdbc.url=jdbc:mysql://localhost/SOME_DATABASE_NAME
    jdbc.user=SOME_USER
    jdbc.password=SOME_PASSWORD

    Save and close. If you haven’t already done so, create a mysql database with the same name, username and password as you specified in install.properties. That database will now be populated by calling the Funambol install script through bin/install. Just answer yes (“y”) everywhere, unless you don’t want the web demo, in which case you answer no to that question, of course. rm -rf tools/hypersonic to save yet a bit more disk space. (Again, there’s a slightly outdated page for this in the Funambol wiki – https://core.forge.funambol.org/wiki/BundleMyPSSQL)

  5. Funambol itself should now run, which you can check by calling bin/funambol start. Check with ps ax | grep funambol and a visit to http://YOUR_SERVER:8080. If it doesn’t work for some reason and you need help, I can recommend #funambol on freenode.net with a tip o’ the hat to Reed there. The easiest way to make Funambol start automagically would be to ln -s /usr/lib/funambol/bin/funambol /etc/rc2.d/S99funambol.
  6. In keeping the headline’s promise, as a last step LigHTTPd has to be configured now. I decided I wanted Funambol running in a subdomain, so I put this piece of configuration into /etc/lighttpd/conf-available/funambol.conf:


    $HTTP["host"] =~ "^(funambol\.).*$" {
    proxy.balance = "fair"
    proxy.server = ( "/" => (
    ("host" => "127.0.0.1", "port" => 8080, "fix-redirects" => 1)
    ))
    }

    After symlinking it into conf-enabled and restarting lighttpd, you should be rid of the :8080 in the URL. Now would be a good time to install the Funambol Admin in your desktop and read funambol-installation-and-configuration-guide-v7.1.pdf to find out how to change the default admin password.

  7. Happy configuring and drop me a comment or an email (anything @ this domain) if you feel like it :-)

Updates:

  • Disable automatic user creation: Open the Funambol Administration Tool, login to your server, go to Server settings and change the Officer entry to com/funambol/server/security/DBOfficer.xml
  • A note on MEM_OPTS: when running Funambol in a vserver (as I do), you may very well run into memory problems. The way it works for me now is to set MEM_OPTS="-Xmx32M" in ctp-server, inbox-listener and pim-listener, but set it to 192M in funambol-server.
  • HTTP status code 417 when using SyncEvolution: That seems to be a known bug with SyncEvolution, but the corresponding SourceForge bug tracker entry is disabled for some reason. I’ve opened a thread on the Funambol forum to maybe get some help with this. In the meantime, port 8080 will do.

2 Responses to “Installing the Funambol bundled server under Ubuntu Server (AMD64) + MySQL + LigHTTPd”

  1. GS says:

    Hey,

    I haven’t been getting much help in the funambol forums about this, and you seem like you know a thing or two. Could you help me out?

    When I used myfunambol portal, the server address was http://my.funambol.com/sync. I prefer to have something similar to this than to have http://xxx.xxx.xxx.x​xx:port/funambol/ds.​ How can I change the URI to something less complicated for my users? Ideally I would like to have it as only my domain name but judging by myfunambol it will need to have http://mydomain/something.

    I’ve changed tomcat to listen on port 80, so I’m rid of the port, but I want to have http://sub.domain.com, and thats it, without the /funambol/ds. Any ideas?

  2. Raphael Schmid says:

    Hi GS,

    unfortunately I pieced the knowledge to get Funambol running together myself (from Google and IRC), so I wouldn’t say I’m even remotely knowledable about it. After a quick look at those pesky XML configuration files I’d say it’s probably not as easy as it should be to change the default path.

    However, since you’re asking for *ideas* — what about using mod_rewrite to just, you know, rewrite your subdomain’s root to blahblah:blah/funambol.ds? That should be the easiest thing to do…

    Good luck!

    - Raphael

Leave a Reply

You must be logged in to post a comment.