Koozali.org: home of the SME Server

Howto install KnowledgeTree on SME8b6 - Help needed

Offline fpausp

  • *
  • 728
  • +0/-0
Howto install KnowledgeTree on SME8b6 - Help needed
« on: December 12, 2010, 07:58:32 PM »
Hi, I try to install KnowledgeTree (Document Management Software) on SME8b6 and like to ask if anyone is interested in a DMS and like to help me ?

What I have tried until now is:

Code: [Select]

# Goto /usr/local/src and download the files
cd /usr/local/src
wget -c http://kt-download.s3.amazonaws.com/kt/3.7.0.2/kt-src-oss-3.7.0.2.tgz

# untar the file
tar xvf kt-src-oss-3.7.0.2.tgz

# move it to /opt/kt/
mv /usr/local/src/kt*/ /opt/kt/

# delete
rm -f kt-src-oss-3.7.0.2.tgz

# install php-xmlrpc
yum -y install php-xmlrpc

# change permissions
chown -R www.www /opt/kt
chmod 777 /opt/kt/config/config.ini
chmod 777 -R /opt/kt/var

# create the mysqluser dms
mysql -e "grant all privileges on dms.* to dms@localhost identified by 'password'"
mysql -e "flush privileges"



# create a Template Fragement

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/

# use nano to make the template-file
nano 88kt

### Begin - Content of 88kt

# KnowledgeTree Document Management

Alias  /kt  /opt/kt

<Directory /opt/kt>
    order deny,allow
    deny from all
    allow from all
    AuthName "kt"
    AuthType Basic
    AuthExternal pwauth
    Satisfy all
    AddType application/x-httpd-php .php .php3 .phtml
    php_admin_value open_basedir /opt/kt/config/:/tmp
</Directory>

### End - Content of 88kt

# Expand the Template
expand-template /etc/httpd/conf/httpd.conf
/etc/rc.d/init.d/httpd-e-smith restart

After these steps I can start the installationwizzard from kt but when It is finished I get some php-errors. Tomorow I will start from scratch and post the errors.
Viribus unitis

Offline fpausp

  • *
  • 728
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #1 on: December 13, 2010, 06:01:01 PM »
Hi,

I was able to install KnowledgeTree under the Primary ibay but when i try to install it under /opt/KnowledgeTree I get errors like:

Code: [Select]
Warning: realpath() [function.realpath]: open_basedir restriction in effect. File(/opt) is not within the allowed path(s): (/opt/knowledgeTree:/tmp) in /opt/knowledgeTree/config/dmsDefaults.php on line 86

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /opt/knowledgeTree/config/dmsDefaults.php:86) in /opt/knowledgeTree/ktapi/ktapi.inc.php on line 44

Warning: Cannot modify header information - headers already sent by (output started at /opt/knowledgeTree/config/dmsDefaults.php:86) in /opt/knowledgeTree/config/dmsDefaults.php on line 315

Any suggestions ?

Viribus unitis

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #2 on: December 13, 2010, 06:49:53 PM »
Please post in the proper forums, since you question is concerning SME Server 8 I am moving this to SME Server 8.x where it is more appropriate.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #3 on: December 13, 2010, 06:54:25 PM »
your problem is "openbase_dir"... searching for it on forums I got: http://forums.contribs.org/index.php?topic=21963.0
For security reasons, php is unable to access anything outside directory it started (and below).
Change that could be a security treat.
By you error message, the script is trying to access /opt and is just allowed to access (/opt/knowledgeTree:/tmp).
So or do you change the path the script is trying to access on line 86 or add /opt int PHPBase using someting like:


/sbin/e-smith/db accounts setprop your_i-bay_name PHPBaseDir /opt/knowledgeTree:/tmp:/opt/ 
/sbin/e-smith/signal-event ibay-modify your_i-bay_name


Good luck
Regards

Jáder
...

Offline piran

  • *****
  • 502
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #4 on: December 13, 2010, 07:21:04 PM »
"...Cannot modify header information - headers already sent..."
Possibly due to gzip compression, this needs to be first:

<?php
ob_start('ob_gzhandler');
# ...whatever
ob_end_flush();
?>
« Last Edit: December 13, 2010, 07:22:39 PM by piran »

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #5 on: December 13, 2010, 07:54:51 PM »
"...Cannot modify header information - headers already sent..."
Possibly due to gzip compression, this needs to be first:

<?php
ob_start('ob_gzhandler');
# ...whatever
ob_end_flush();
?>
In this case it seems more likely to me that the error being printed to the screen is the case.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline piran

  • *****
  • 502
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #6 on: December 13, 2010, 08:12:32 PM »
In this case it seems more likely to me...
A suggestion, for which the OP asked, no more or less
particularly without knowing or viewing the files' content.
Seemed more likely to me that given the OP's lack of
knowledge of very basic open_basedir stuff then the
OP would appreciate just such a pointer.

Offline fpausp

  • *
  • 728
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #7 on: December 14, 2010, 08:25:43 AM »
Hi all,

@jader
Quote
/sbin/e-smith/db accounts setprop your_i-bay_name PHPBaseDir /opt/knowledgeTree:/tmp:/opt/
/sbin/e-smith/signal-event ibay-modify your_i-bay_name
I tried the db commands on the old installation and still got the php-errors.
I made a new installation and added the /opt/ into the template fragment, I think it is taken effect now.


@piran
Quote
<?php
ob_start('ob_gzhandler');
# ...whatever
ob_end_flush();
?>
I am sorry should I do something with it ?


I have done another installation with this commands:
Code: [Select]
# download and untar the files
cd /usr/local/src
wget -c http://kt-download.s3.amazonaws.com/kt/3.7.0.2/kt-src-oss-3.7.0.2.tgz
tar xvf kt-src-oss-3.7.0.2.tgz
mv /usr/local/src/kt*/ /opt/knowledgeTree/
rm -f kt-src-oss-3.7.0.2.tgz

# Install php-xmlrpc
yum -y install php-xmlrpc

# change permissions
chown -R www.www /opt/knowledgeTree
chmod 777 /opt/knowledgeTree/config/config.ini
chmod 777 -R /opt/knowledgeTree/var

# create mysql-user
mysql -e "grant all privileges on dms.* to dms@localhost identified by 'password'"
mysql -e "flush privileges"

# Create a Template Fragement
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/

nano 88knowledgeTree

------------------- content of 88knowledgeTree-----------------------

# KnowledgeTree Document Management

Alias  /knowledgeTree  /opt/knowledgeTree

<Directory /opt/knowledgeTree>
 AllowOverride All
 order deny,allow
 deny from all
 allow from all
 AuthName "knowledgeTree"
 AuthType Basic
 AuthExternal pwauth
 Satisfy all
 AddType application/x-httpd-php .php .php3 .phtml
 AddType application/x-httpd-php-source .phps
 php_admin_value open_basedir /opt/knowledgeTree:/tmp:/opt/
</Directory>

------------------- content of 88knowledgeTree-----------------------

Save by pressing Ctrl x, press y to save changes and press enter

# expand template
expand-template /etc/httpd/conf/httpd.conf
/etc/rc.d/init.d/httpd-e-smith restart

# goto the wizzard
http://192.168.1.245/knowledgeTree

# after the wizzard
signal-event post-upgrade; signal-event reboot

Situation now is:
Code: [Select]
http://<server-ip>/knowledgeTree returns with:

Not Found

The requested URL /customerrorpage.php was not found on this server.
Viribus unitis

Offline piran

  • *****
  • 502
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #8 on: December 14, 2010, 12:49:54 PM »
@piranI am sorry should I do something with it ?
Use the hint to learn something about output buffering?
http://php.net/manual/en/function.ob-start.php

Situation now is:
Code: [Select]
http://<server-ip>/knowledgeTree returns with: Not Found
The requested URL /customerrorpage.php was not found on this server.
So, the clue is in the error syntax, just put one there...
Code: [Select]
<?php
header
("HTTP/1.1 404 NOT FOUND");
echo 
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo 
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
echo 
'<head>';
echo 
'<meta http-equiv="content-type" content="text/html; charset=UTF-8">';
echo 
'<title>NOT FOUND</title>';
echo 
'<meta name="description" content="NOT FOUND">';
echo 
'<meta name="keywords" content="NOT FOUND">';
echo 
'<meta name="robots" content="noindex,nofollow,noarchive,nosnippet">';
echo 
'</head>';
echo 
'<body>';
echo 
'*NOT FOUND*';
echo 
'</body>';
echo 
'</html>';
?>


Offline Marco Hess

  • *
  • 149
  • +0/-0
    • http://www.through-ip.com
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #9 on: December 23, 2010, 10:29:41 AM »
I have working KnowledgeTree installation on my SME7 server. Not sure of it helps with your problem, but my httpd.conf template part is as follows:

Code: [Select]
Alias /knowledgeTree /opt/knowledgeTree
<Directory /opt/knowledgeTree>
  AddHandler php5-cgi .php
  Action php5-cgi /php5-cgi/php-cgi
  Options Indexes
  AllowOverride All

  Order Deny,Allow
  Deny from All
  Allow from 127.0.0.1 10.1.0.0/255.255.255.0

  php_flag magic_quotes_gpc off
  php_flag upload_tmp_dir /opt/knowledgeTree/tmp
  php_value include_path  '.:/opt/knowledgeTree'
</Directory>
Adelaide - Australia

Offline fpausp

  • *
  • 728
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #10 on: December 23, 2010, 03:07:09 PM »
Hi Marco,

I had the same idea yesterday and installed kt (3.1b) on my virtual sme7, i will test this in a few days on sme8.

Merry Christmas
Viribus unitis

Offline Marco Hess

  • *
  • 149
  • +0/-0
    • http://www.through-ip.com
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #11 on: December 24, 2010, 12:53:12 AM »
I installed kt (3.1b) on my virtual sme7

I am running KnowledgeTree Version 3.7.0.2 (Community Edition)

And a Merry Christmas to you too.

Regards,

Marco
Adelaide - Australia

Offline fpausp

  • *
  • 728
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #12 on: December 24, 2010, 02:34:02 PM »
Hi all,

I finished my work with the ChristmasTree and KnowledgeTree :-)

I wrote a little script located on:

http://www.netztechnik.at/download/sme8/howto/knowledgeTree/inst-kt.sh

Please test it on your own risk and feel free to give me feedback to make it better.

Regards
Viribus unitis

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #13 on: December 24, 2010, 05:35:08 PM »
IMO this should be posted in the wiki

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #14 on: December 24, 2010, 10:39:54 PM »
I wrote a little script located on:

http://www.netztechnik.at/download/sme8/howto/knowledgeTree/inst-kt.sh
I think this is not the best solution, although it allows for a quick and easy installation it also does not show the user what it does or where it might go wrong. I agree with Stefano that a instruction in the wiki is preferable, IMHO even as a step by step instruction.

Please test it on your own risk and feel free to give me feedback to make it better.
I think the permissions for the configuration files and /opt/knowledgeTree/var can be more restrictive as setting them world writeable is never a good thing, I think this:
Code: [Select]
# change permissions
chown -R www.www /opt/knowledgeTree
chmod 777 /opt/knowledgeTree/config/config.ini
chmod 777 -R /opt/knowledgeTree/var
should also work with 755, perhaps even with 644.

I also wonder why you are creating a separate user for your script with such broad permissions (effectively a user with all privileges on all databases), if you are to do so you might as well use the mysql root account.
Please keep in mind that when scripting things, actions in the script should be controlled very well and permissions should be set to minimum required values IMHO.

That said, I think it is a good thing that someone took the time to work through installing KnowledgeTree and giving back to the community.
« Last Edit: December 24, 2010, 10:45:46 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline fpausp

  • *
  • 728
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #15 on: December 25, 2010, 02:23:26 PM »
Quote
I think this is not the best solution, although it allows for a quick and easy installation it also does not show the user what it does or where it might go wrong. I agree with Stefano that a instruction in the wiki is preferable, IMHO even as a step by step instruction.
When all problems are solved i will create a step by step instruction for the wiki, the script should just save time.

Quote
I think the permissions for the configuration files and /opt/knowledgeTree/var can be more restrictive ...
I have to work them out ... Maybe someone can help me ?

Quote
I also wonder why you are creating a separate user for your script with such broad permissions ...
Thats because I dont know the mysql-root password for the setup-wizzard. The user temp should be deleted after the db and dbuser is created as described in the script.

Viribus unitis

Offline fpausp

  • *
  • 728
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #16 on: December 26, 2010, 09:51:40 AM »
Hi,

Ok I think I am ready to start writing the KnowledgeTree-Howto on the Wiki. I tried to login but my username/password is not working, is there a special way/mailaddress to solve that because I am already in the Wiki/Docs Group ?
Viribus unitis

Offline fpausp

  • *
  • 728
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #17 on: December 26, 2010, 07:13:42 PM »
I wrote a draft-howto in raw format and put it to:

http://www.netztechnik.at/download/sme8/howto/knowledgeTree/howto-knowledgeTree.txt

This should work until I am able to login to the sme-wiki.

Best
Viribus unitis

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #18 on: December 27, 2010, 04:13:21 PM »
I have to work them out ... Maybe someone can help me ?
I already suggested them to you, normally 755 would do, but perhaps even more restrictive (644) does also work.
Thats because I dont know the mysql-root password for the setup-wizzard.
You don´t need to the password is automatically supplied by some magix on SME Server when logged in as root.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline fpausp

  • *
  • 728
  • +0/-0
Re: Howto install KnowledgeTree on SME8b6 - Help needed
« Reply #19 on: December 27, 2010, 05:44:01 PM »
Quote
I already suggested them to you, normally 755 would do, but perhaps even more restrictive (644) does also work.
Have you red my howto - 26122010 ?

Quote
You don´t need to the password is automatically supplied by some magix on SME Server when logged in as root.
Have you tried the Installation Wizzard ?
« Last Edit: December 27, 2010, 05:48:45 PM by fpausp »
Viribus unitis

Offline fpausp

  • *
  • 728
  • +0/-0