KnowledgeTree 3.7.* -Install Solaris

From KnowledgeTree Community

Jump to: navigation, search

At the time of writing there is no official support for knowledge tree on Solaris, this guide is confirmed to work. It should also be noted that there are no real advantages to running knowledgeTree on Solaris, in fact, it's a much better choice to use a Linux distribution due to Zend support etc. I will, however, report that in spite of the lack of documentation and support knowledgeTree is straightforward to install and runs pretty well on Solaris x86 and I can see no reason why it wouldn't run on SPARC.

Currently the guide does not include the following:

  • Commercial Version Installation Testing
  • Installation on SPARC platforms
  • Zend Optimiser support (According to Zend this will never happen).
  • Any set-up changes that aren't mentioned here.

Knowledge Tree requires the following components:

  • PHP 5.2.x
  • PHP LDAP extension (if LDAP or ActiveDirectory integration is required)
  • PHP Exif extension (if header extraction from JPEG and TIFF files is required)
  • PHP mbstring extension (functions for multi-byte character sets)
  • PHP mysql extension (interface to mysql database from php)
  • PHP json extension (functions for working with json structures)
  • PHP fileinfo extension (functions for resolving mime types of documents)
  • MySQL Server, Client, and PHP libraries, version 5.1 or above
  • Apache 2.0 or above
  • Java Runtime Environment 1.5+ (Required for Apache POI and Lucene)
  • pstotext (required for indexing of postscript files)
  • OpenOffice 2.4+ (required for PDF conversion, we'll use star office).
  • Info-Zip (required for extracting contents of zip files)

If you run a Version update (i.e. 3.8 or whatever) or small patch please document that here.

Contents

Solaris Install Instructions

Tested on Solaris 10 x86:

   5.10 Generic_138889-08 i86pc i386 i86pc

Versions to test:

   Solaris 10 Sparc
   Open Solaris
   Older Versions of solaris

You'll want to use bash for this entire guide. When you login just type:

   bash

Installing and Configuring Blastwave

Just go to: [1]

Make sure the correct paths are in your bash profile: Edit "/etc/profile" and add:

   PATH=/opt/csw/bin:$PATH

For this to take place you'll need to logout then back in again. For now you can just type:

   export PATH=/opt/csw/bin:$PATH

Apache, MySQL, PHP and other components

To install:

   pckgutil -i apache2 mysql5 php5 ap2_modphp5 php5_mysql php5_mysqli php5_curl php5_ldap pstotext

To start, stop and restart apache:

   svcadm enable cswapache2
   svcadm disable cswapache2
   svcadm restart cswapache2

To set the mysql bin to be in your path edit the line made before to be '/etc/profile':

   PATH=/opt/csw/bin:/opt/csw/mysql5/bin:$PATH

You'll have to logout and in again for the changes to take effect so just type the following in to the command line and it should work:

   export PATH=/opt/csw/bin:/opt/csw/mysql5/bin:$PATH

Setting up the MySQL database

run the blastwave quick start script:

   /opt/csw/mysql5/share/mysql/quick_start-csw

Start the mysql server deamon:

   svcadm enable cswmysql5

Now we'll secure MySQL, enter a password for root when prompted, all other options should be set to yes for production use:

   /opt/csw/mysql5/bin/mysql_secure_installation

Configuring Apache for KnowledgeTree

This Guide assumes that the Apache server does not have virtual hosts and that the box/zone will just be used for knowledgeTree. For infor on how to set up virtual hosts consult the apache documentation.

Create an apache user and group. You want the apache process to have access to some ktree files but they won't be web accessible.

  groupadd apache
  useradd -G apache apache
  mkdir /opt/ktree
  chown ktree:ktree /opt/ktree


You'll need to create the var folders for knowledgeTree to use later. I made them outside a web accessible directory but usable by apache.

   mkdir /opt/ktree/var
   mkdir /opt/ktree/var/log
   ""         ""       /cache
   ""         ""       /tmp
   ""         ""       /uploads
   ""         ""       /cache
   ""         ""       /Documents
   chown -R apache:apache /opt/ktree/var

Edit /etc/opt/csw/apache2/httpd-conf

Set the user and group to apache:

   User apache
   Group apache


Set DocumentRoot to knowledgeTree's install path:

   DocumentRoot "/opt/ktree/knowledgetree"

Change the Directory:

   <Directory "/opt/ktree/knowledgetree">
   .....

KnowledgeTree

Install and configure knowledgeTree through the web as you would following the web instalation guides. This guide uses the directory "/opt/ktree/knowledgetree" as the extraction point for the kt-src-oss-3.7.0.2.tgz file.


Broken Package Extraction

When extracting the kt-src-oss-3.7.0.2.tgz package I encountered errors, stating incomplete extraction with the default solaris tools. This will cause problems later on. For this you have two options. Unpack it on your local machine and transfer the individual files or install the gnu gzip and extract it with that. e.g.

   pkgutil -i gzip
   gzip kt-src-oss-3.7.0.2.tgz
   tar -xf kt-src-oss-3.7.0.2.tar
   mv  ktgit-knowledgetree-c389d34 knowledgetree

Starting a star office headless deamon

Star office 8 version 11 comes with Solaris 10 is basically OpenOffice 2.4 re-branded and so works in exactly the same way. To start it in headless mode:

   soffice -headless -accept="socket,host=localhost,port=8100;urp;" -nofirststartwizard&
  

Alternatively you could install openoffice from blastwave. The start command should be the same though this hasn't been tested so I can't confirm if this will work.

Starting The Apache Lucene Server

For some reason for this to work and not complain about KnowledgeTreeIndexer.Logging.properties not being there I had to run it from <knowledgetree path>/bin/lucene:

   java -Xms512M -Xmx512M -jar /opt/ktree/knowledgetree/bin/luceneserver/ktlucene.jar&

KnowledgeTree Services

Set up cron jobs as usual. Remember to specify the php path correctly.

Also note that this method for every 5 mins won't work with solaris 10 crontab -e:

    */5 * * * * /path/to/script

Instead you should add a line like this:

    0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/script

You'll want your editor to be vi. To add a cron job do the following:

    export EDITOR=vi
    crontab -e

My cron job is set as follows:

    0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/csw/php5/bin/php /opt/ktree/knowledgetree/bin/scheduler.php

Edit occasionally I get the following errors from mail:

    sh: : cannot execute

The indexer doesn't seem to empty when the scheduler is hit either. I will investigate what causes thiese issues.

The scheduler seems to work though occasionally it comes up with this error. I suggest installing and using CSW/curl:

    pkgutil -i curl

Then change your crontab to include:

     0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/csw/bin/curl -s http://localhost/search2/documentProcessor/bin/documentProcessor.php   
     0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/csw/bin/curl -s http://localhost/bin/scheduler.php
Personal tools