Knowledgetree Command Line Drop Box in Perl

I needed an easy way to push documents to the KT implementation. After looking at how KT’s windows drop box software works I wrote something similar in Perl that works from the command line.

I plan to wrap an Automator action around this to upload documents easily.

Knowledgetree Document Management System on a WHS

I setup Knowledgetree on my WHS because I didn’t like other options and it was free. I didnt want to use the canned installation because I didn’t want Apache and openoffice running in the background taking up my ram.

KT = Knowledgetree
WHS = Windows Home Server

  1. Setup a shared directory for kt with duplication, in my example I am going to use DMS you can use DMS$ if you want it hidden from browsing
    1. Add the users that are going to use KT
  2. Install the WHS PHP Extension
    1. http://www.mediasmartserver.net/downloads/add-ins/WHSPHP_1.0.4.zip
  3. Install WHS MySql Extension
    1. http://www.mediasmartserver.net/downloads/add-ins/MySqlInstallerForWHS_0.0.8.zip
    2. Change your mysql root password at http://localhost/pma
  4. Enable curl in php.ini
    1. Edit c:\php5\php.ini and add extension=php_curl.dll under the other extensions
  5. Install SUN Java 1.6
    1. http://www.java.com/en/download/manual.jsp
  6. Download the KT Source Code its about 60mb, the Windows version.
    1. http://www.knowledgetree.com/products/opensource/downloadopensource
  7. Extract KT to d:\dms
    1. Add full rights for the “Windows Home Server Users” group to d:\dms
  8. Create a virtual directory under the default website in IIS called DMS and using d:\dms as the document root
    1. Disable anonymous authentication and enabled basic authentication
  9. Run the KT setup at http://localhost/dms
  10. Setup the httpsso for single sign-on to your whs users.
    1. http://forge.knowledgetree.com/gf/project/httpsso/
    2. you must first manually make the matching user in KT first.
  11.  Scheduled Tasks 
    1.  ktscheduler – runs internal tasks
      1. Run: c:\php5\php.exe d:\dms\bin\scheduler.php
      2. Start in: d:\dms\bin
      3. Run As: NT AUTHORITY\SYSTEM
      4. Run every 15 minutes for 24 hours
    2. ktlucene
      1. Run: “C:\Program Files\Java\jre6\bin\java.exe” -jar D:\DMS\bin\luceneserver\ktlucene.jar
      2. Start in: D:\DMS\bin\luceneserver
      3. Run As: NT AUTHORITY\SYSTEM 
      4. Run at system startup
      5. Uncheck the stop the task if it runs for 72 hours
    3. ktDbBackup
      1. Run: C:\php5\php.exe d:\dms\ktdbbackup.php
      2. Start In: d:\dms
      3. Run As: Administrator (needs network access for backups)
      4. Run every 12 hours for 24 hours