Installing DeskNow on FreeBSD • 27 Oct 2010
DeskNow is a mail and collaboration suite which runs on a diversity of operating systems. Today I installed it on a FreeBSD system, and I kept a log of what I did for future reference.

The server I used ran FreeBSD 8.1-STABLE, and its IP address is 10.0.0.51. DeskNow can store its data in a variety of databases; I chose to use MySQL. Furthermore, it's written in Java.
Login as root and bring the ports tree up to date, if necessary.

Java 1.6 runtime
I wish installing Java on FreeBSD didn't require me to jump through bureaucratic hoops. It's slightly more convoluted than installing a standard port.
# cd /usr/ports/distfiles
Point a webbrowser at FreeBSDFoundation.org and accept the license terms; put the downloaded file diablo-latte-freebsd7-i386-1.6.0_07-b02.tar.bz2 in /usr/ports/distfiles.
# cd /usr/ports/java/diablo-jre16
# make config install clean
Uncheck the option 'Update the time zone data', and choose OK. The JRE will install now. It also pulls in some X libraries because of Swing.

JDK 1.6
Another hoop. Visit FreeBSDFoundation.org with your webbrowser and place the downloaded file diablo-caffe-freebsd7-i386-1.6.0_07-b02.tar.bz2 in /usr/ports/distfiles, then:
# cd /usr/ports/java/diablo-jdk16
# make config install clean
Again, clear the 'Update the time zone data' option before choosing OK.

MySQL 5.0
Important: Install version 5.0, not 5.1 or higher, since DeskNow uses 'TYPE=INNODB' in its table creating code, and MySQL 5.0 is the last version which understands the 'TYPE=' specification (more recent versions of MySQL expect 'ENGINE=...')
# cd /usr/ports/databases/mysql50-server
# make WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_COLLATION=utf8_unicode_ci install clean
# rehash
# mysql_install_db
# chown -R mysql:mysql /var/db/mysql
# mysqld_safe &
# mysqladmin -u root password SECRET
And we have to create a database for DeskNow:
# mysql -uroot -pSECRET
mysql> create database desknow character set utf8;
mysql> grant all privileges on desknow.* to desknowserver@localhost identified by 'SECRET';
mysql> grant all privileges on desknow.* to desknowserver@'%' identified by 'SECRET';
mysql> \q
Add the line mysql_enable="yes" to /etc/rc.conf, so that MySQL will start automatically when the server starts.

MySQL connector for Java (JDBC)
Finally, just a standard install from ports...
# cd /usr/ports/databases/mysql-connector-java
# make install clean

Desknow
Get DeskNow itself from the DeskNow site. At the time of this writing, October 27th 2010, I got production version 3.2.14.
# cd ~
# fetch http://www.desknow.com/downloads/desknow.tar.gz
# tar xvf desknow
# cd desknow_server
# cat readme.txt
# mv desknow /var
# mv desknowdata /var
# mv etc/desknow.conf /etc
# mv etc/init.d/desknow /usr/local/etc/rc.d
Edit the file /etc/desknow.conf such that JAVA_HOME="/usr/local/diablo-jdk1.6.0".
The mysql-java connector has to be copied to desknowdata/lib:
# cp /usr/local/share/java/classes/mysql-connector-java.jar /var/desknowdata/lib

Desknow initial configuration
Run the console configuration wizard:
# /var/desknow/bin/configconsole.sh
These are the answers I gave:
IP adres: 1) All
HTTP: 80
HTTPS: 443
Instant messaging: no
Mail server option: 1 (complete mail server)
Authorized IP adressen: 10.0.0, 10.0.1, 127.0.0
Mail domain: yourdomain.nl
Default language: en
Default spelling: EN-US
Password for 'admin': SECRET
Now it's time to start DeskNow:
# /usr/local/etc/rc.d/desknow start
Add this line to /etc/rc.conf to have DeskNow start automatically when the server starts: desknow_enable="yes"

Desknow database configuration
Start your webbrowser and point it to the DeskNow instance (http://10.0.0.51 in my case). Enter the following values on the Database Initialization Wizard form:
Database type: MySQL 4.1 or later
Database address (IP or hostname): localhost
Database port: 3306
Database name: desknow
Database username: root
Database password: SECRET
Database password (confirm): SECRET
...and click OK. If all went well, you should now be presented with the login screen of DeskNow. Login using user name 'admin', password 'SECRET', and you can configure the rest of DeskNow from its built-in admin webinferface. Congratulations!