Jeremy Davis's picture

[9-04-2013] Note: this patch has been abandoned. It is not considered stable and will not be released as an official TKL appliance. See my post here for further details.

[Updated 20-01-2012] Major re-write of patch. A new patch - a new thread! :)

[Updated 30-01-2011] Minor bugfix to resolve this issue.

[Updated 21-10-2010] Just uploaded the latest patch version and edited the details in this post. Some more tweaking could be done, but I think that's me for now...

[Updated 14-10-2010] I have basically rewritten this post and deleted all the old and mostly irrelevant stuff. I have uploaded my latest patch - which completely installs KT! Still some finishing touches required but KT works out of the box! :)

I've been plugging away at this patch for a while now but finally I've had a major breakthrough! Thanks to everyones assistance and encouragment, particularly Adrian, Basil and the Dynamic Duo (TKL devs Alon & Liraz).

This patch will install KnowledgeTree Community Edition (KT-CE) v3.7.0.2 and all of it's dependancies from repositories (standard Ubuntu Lucid + Cannonical partner + KT-CE + Zend Server). This means that in the future as new versions are released this appliance will be able to be fully upgraded using apt-get upgrade. The one dependancy I was having problems with (libmysqlclient15off - which I was using from Karmic and installing as a deb) is now in the Zend Server repo so no dodgey files etc. KT-CE sits on top of a version of Zend Sever which uses php5.2 but as all these packages come from Zend Server's repo I figure that should be ok!?

It no longer includs Basil's LAMP patch as KT happily takes care of it's own dependancies (including Apache2 and MySQL) so there is no real need for it (besides Zend removes standard php and breaks phpMyAdmin).

I have only tested this patch by installing to a running instance of TKL-Core-Lucid beta but I assume it should work for patching an ISO too. I have not tested everything (such as emailing etc).

To use:

After patching and installing TKL-Core-Lucid beta (or vice versa):

1) Start Apache2, MySQL and KT:

service apache2 start 
service mysql start 
cd /usr/share/knowledgetree-ce
./dmsctl.sh start

2) Browse to https://<appliance-ip>/knowledgetree/ (currently http also works but ideally I think it would be good to force to force https for security - at least for login and the admin area).

3) Log in - KT login remains the default for a clean install - username: admin password: admin

What the patch does so far (in order):

  • Sets hostname to 'knowledgetree'. [pre-overlay conf]
  • Installs gnupg. [pre-overlay conf]
  • Imports and installs KT & Zend apt-keys (uses gnupg) [pre-overlay conf]
  • Adds the Cananocal Partner, KnowledgeTree-CE & Zend Server repos to /etc/apt/source.list.d as individual .list files. [pre-overlay conf]
  • Installs KT-CE from KT repo (as per usual, auto-installs all dependancies, including Zend Server php5.2) [pre-overlay conf]
  • Installs other stuff (postfix, ssl-certs, apache & postfix webmin modules). [pre-overlay conf]
  • Create MySQL user, create and populate database. [pre-overlay conf]
  • Adds an amended usage.txt to Confconsole output. [overlay]
  • Adds other required files (so KT WebUI "Installer" doesn't run) [overlay]
  • Adds config files for Postfix, MySQL new secret generation, etc. [overlay]
  • Changes ownership of KT doc root to www-data:www-data [post-overlay config]
  • Stops Apache2 & MySQL services (so patching finalises cleanly). [post-overlay conf]
  • Cleans up apt.[post-overlay conf]
  • Apache, MySQL and KT will autostart on boot.

Other things I'd like to do (but may not get to):

  • Test emailing - Really should do this!!
  • Force https access, at least for login screen and admin pages.
  • Set KT-CE root as Apache document root (so KT is available at https://<ip>/ rather than https://<ip>/knowledgetree/) .
  • Look at what KT plugins are available which may be useful for TKL community
  • Consider what documentation will be required.

Known Bugs

  • None known currently.

Feedback warmly welcome! So if anyone has anything useful to add, please post :)

Also please note that KnowledgeTree is a pretty huge app and as well as considerable Ubuntu dependancies, it downloads 250MB+ from the KT & Zend repos (about 370MB in total).

This patch is also available on GitHub here.
Precreated ISO and OVZ templates are available on the TKL Community Downloads SourceForge page here.

Forum: 
Adrian Moya's picture

Don't feel sad, it's by working on this things that you'll get to master them. Believe me, when I first offered the Alfresco appliance about one or two years ago, I was still a newbie. Now after lot of practice at home, I've mastered a few skills. And you are in the right place to learn. 

I won't promise anything on this one, as my queue is getting large. I installed KT in the days of alfresco, when I was evaluating this kind of soft for the company I worked on. 

Quick comments: I wouldn't mix packages from different editions. This would lead to a mess later, believe me! I'd had to look at why are they not supporting lucid packages yet. I suspect is because of php 5.3. But in any case, maybe it's preferred to base this appliance on hardy.

I think you feel the pressure I  feel with this release. There are so many things I'd like for this release, and I hope to get them done before the dynamic duo finish the core appliances. This is what's keeping you of finishing this one. But keep the work, I think we have a couple of weeks more. 

When you are in doubt, ask and I'll try to help. 

P.S.: Doing a quick search I'm surprised you actually came to the libmysqloff packages as they explain in the forums. Good job there. I think swtools are in the partner repo, see my explanation in the alfresco patch (I think it was there where I used it). Maybe this can work with only this karmic deb. Mmmm, Lets see what Liraz thinks about it (but I think you won't get your pony). 

You're almost there! hostname, clean apt, confconsole text is easy. Now, what's exactly Finalise installation/configuration of KT? You must break this in steps that have more significance. 

Jeremy Davis's picture

I really want to see this based on Lucid and for my own purposes I was keen to make it work. But I guess its up to Liraz and Alon whether they are happy to use it with a potentially dodgey hack (ie the libmysqloff deb). I haven't tried but maybe TKL would prefer a Lenny based patch (not sure if it'd work but should be easy to check).

Thanks for the heads up on swftools being in the partner repo. I must admit I was surprised when I couldn't find it in the normal repos (and I hadn't come across any mention of people having issues with that one - that explains it). That will halve the unsupported (ie non repo) debs! :)

Although I haven't done it all and tested it, there is plenty of info here on TKL re hostname, clean apt, confconsole text so I agree that will be easy. But the bit that gets me is how to automate the web based install. Is there a way I can do a diff of the filesystem of 2 VMs? To see what changes before and after the install/finalisation. I spose I could mount them both in a third VM? Also I guess that doesn't cover stuff in a database, SQL scares me! Or what is a better way to find out what the web interface is doing behind the scenes? Trying to actually read the code and understand what its doing is probably not going to work for me. Even complicated Bash scripts do my head in sometimes (that's why I love the way you explain your patches so clearly).

Actually that makes me think, how do you do it, I mean surely some of the patches you've worked on have web based install/finalisation? It seems quite common/ Is there a process you follow or is it ad-hoc per appliance?

Perhaps I'll go through the whole process and document what info needs to be put in and that may give me some more ideas.

Thanks again mate :)

Hi JedMeister,

 

Congratulations on your first Patch.

There is an easy method to automate web installation. Please check my Vanilla forum patch . First of all install it on a machine mannually by mouse clicks. Then take the sqldump of the databases to a file and add them in overlay/root or overlay/tmp . Then analyse the configuration files where your credtials are stored. Add them also in the overlay. Then during patching process move the configuration files from overlay/root or overlay/tmp to required locaton, so that it overwrites existing configuration files . Then import the mysqldump files.

Jeremy Davis's picture

You make it all sound so easy! I'll have to have a play when I get home tonight! Thats given me heaps to work with.

Thanks for the heads up about your Vanilla patch being somewhat similar. That will healp me heaps. I find I learn best in little chunks, so having something of a template to hack I find easier than sitting down reading heaps of theory. In retrospect I was perhaps a little lazy that I didn't disect some of the other patches to see exactly how they work.

I may be able to get this one done after all. Yay :)

Adrian Moya's picture

Not all changes are in the database. Some times, installation scripts write files, change permissions, and do other stuff. Thats what Basil mention in "Then analyse the configuration files where your credtials are stored." You would have to test well your appliance. Use /tmp for temporal overlayed files, or you'll have Liraz talking about the FSH in your thread ;)

My strategy on this may not be valid for you, as I have programming skills, but maybe it does help:

I always check the code of the application installation script. Generally, they write a file with the configuration and run a script (the case of iRedMail or FreePBX script) or they accept parameters (the case of magento). Config files are always easy to spot. (you know, that "config" file should be the config file!). Or they are under a config directory. Generally, you should see a mysql user/pass there. The best way is as Basil suggest, first run the installation manually and set an easy user/pass. Then look for those in the files. If the file is complicated (long, lots of settings) overlay it. If you only have to change username and pass, you can always use sed. You'll find plenty of examples in my patches. 

Other tip, if installing from deb, maybe during configuration the package is creating the db and setting some configurations. As you are using a deb, you should check what the package is doing for you. You can overlay the settings files in the place where they end in the package installation and they won't be overwritten. 

But the best in this case is to try to find the installation script and run it in your patch. That way you can rest that nothing in the installation is being missed.

And remember to always use TKLDevEnv patch, as it will speed up your development. UPS! I haven't published it yet :D soon! 

Jeremy Davis's picture

I had a bit more of a play last night and fixed/updated a couple of the minor bits (but haven't updated the uploaded patch). I also confirmed that swftools is in the partner repo (and added canonicalpartner.list to the overlay) so that's a little nicer! Halved the non repo debs! :)

Unfortunately I got sidetracked by this udev issue and spent way too much time trying to work out what was going on there. But hopefully I'll get back to it tonight again after work and have a more involved look.

I wish I knew more about programming. Perhaps I should consider doing a course? As I think I've mentioned somewhere I did a bit of Turbo Pascal way back when, so I'm sure I could learn, I guess I'm just lazy, or maybe its because all this stuff is more of a hobby and its just not that relevant to the rest of my life?

Anyway, really appreciate your patience and help guys. Yay for the TKL community :)

Adrian Moya's picture

Check one of the modern languages/frameworks. They make programming so easy! And all the good practices are there. Using DRY and Convention over Configuration makes new programmer's life easy. And the programmer may be a newbie, but following the rules of the community makes him quickly adopt practices that long time programmers still can't embrace (like unit testing, separation of the view and the code, ORM, etc). That' why I fell in love with Rails. As I like to teach, I feel that teaching a language & framework that guides new people on the right track, really helps the programming community better. 

As you can see, I always talk about frameworks. Modern programmers must learn frameworks, I still see in my work people doing things by hand, when almost all is done in a framework. If you master a framework, you'll be quickly a better programmer than someone doing things entirely "in house". 

And if you think in TKL, maybe Python/Django is the right way, as TKL Devs use those. I took my first steps the other day and it's very easy (at least comparing to java). 

And maybe right now is not that relevant, but it can be if you really like it. My boss, which I consider an great professional, and linux guru (I'm learning a lot from him) studied chemistry! I couldn't believe when he told me he was a chemistry engineer! You never now where this river is going to take you!

Jeremy Davis's picture

Its sounds like the programming paradigm has shifted quite a bit. But a lot of the acronyms and terms go straight over my head. No need to explain ATM though. I'll probably just keep blundering along for now but I'll keep it in mind (especially the bit about you liking to teach :p). I have heard lots of good things about rails, so that sounds like it could be worth a look and python seems quite pervasive, not to mention useful.

That reminds me Rudiger suggest an app called quickly a while back and I recently (and randomly) came across a tutorial about it that reminded me. It looks really neat for development of apps, especially ones with GUI. In that same thread Liraz raised some valid points but for someone like me I think it could be ideal. Apparently its quite suited to python and makes some stuff that I would possibly find daunting (such as building a GUI interface) straight forward. Apparently it hooks up with PPA too so publishing your app when you're done is all too easy.

I've learned so much about Linux (Ubuntu specifically) over this last year and a half being a part of the TKL community. Mostly it has been the same way I learned about Windows ten years ago, playing with stuff, breaking it and then trying to fix it again. Thats my main strength when it comes to computers and tech really; patience and tenacity (not that you'd guess from my intial post on this thread!) And I seem to be blessed with the ability to find good info online which helps heaps!

Jeremy Davis's picture

I have updated the original post with some new info and I have uploaded a new (untested) version of the patch. I know its probably bad form to post an untested patch but I wanted to put up my progress (for myself more than anything else) and I figured as its still incomplete it shouldn't be a big deal.

After spending a bit of time on this tonight, I am much less overwhelmed than I was. That is for 2 main reasons: 1) I sat down and manually stepped through the web based install (after the apt-get install) and carefully documented what it all says it does. There actually isn't a lot of info you need to add, its pretty straightforward. And then 2) I accidentally came across a link to a very handy article (which is a little dated but still useful) that explains exactly how to do a 'manual install' ie avoid the web install! I haven't read through it all thoroughly (and it goes into much more detail than I think I'll need eg changing ports etc) but it looks like it will almost 'hold my hand'. Nice!

So there's still plenty to do and then I'll need to test it from scratch to make sure it all works but its looking possible and that I will be able to do it! In many respects its possibly an ideal first patch.

But none of this would've been possible without the encouragement and support of you guys (Adrian and Basil). So thanks so much for encouraging me to stick it out and keep going!

Jeremy Davis's picture

Still plugging away at this one. Tidied up the patch a little. I added 2 webmin modules to Basil's LAMP patch (apache and phpini) not sure that they're really needed but the Webmin apache module made it really easy to find where the KT doc root was. For the record its /usr/share/knowledgetree-ce which may well be a likely place to find it but I didn't have a clue.

As for the install I haven't got a lot further but it seems that all I have to do is create a database (called dms) and create the contents using some .sql scripts provided by KT. Then there is a php script to run which 'updates' the database. I'm not sure why it would need updating after just building it, but who am I to question - when I don't really even know what I'm doing! :)

Other than that I have to make KT autostart on boot, which there are clear instructions for on the KT website (although they apply to Hardy so not sure if they still apply to Lucid, I'll try and find out). For some stupid (at least IMO) reason you have to do that manually on Linux, even with a 'normal' install.

Once I've got that sorted then the only obvious tweaks from standard that I'd like to make are enforcing https. And moving the web root from https://xxx.xxx.xxx.xxx/knowledgetree just to https://xxx.xxx.xxx.xxx/ That is because currently you just get the "It works" apache page which seems silly on a dedicated KT server. If anyone has a good reason why I shouldn't do that please let me know.

Adrian Moya's picture

Maybe the webin module helps you get it right, but to change /knowledgetree to / is simply edit the apache virtualhost file (located in /etc/apache2/sites-available/) Check that by default, authentication is not being redirected to https. If so, you wont have to force all the app to use https. If not, you'll have to make your own virtualhost file (again in the same dir) with the settings and in the original, non-ssl file set the redirection using apache's rewrite module (which you'll activate with the command a2enmod rewrite).

Check some of my patches to see examples of apache virtualhost files. (see overlayed files in /etc/apache2/sites-available/) and the conf file to see how I enable/disable sites and modules. 

The start at boot instructions should work on lucid, not much have changed there besides the prefered way of using the service command instead of calling the script directly. IE: instead of "/etc/init.d/apache2 restart" use "service apache2 restart".

You're doing well!

Jeremy Davis's picture

After having disecting some of the other patches I have added the MySQL bits I'm pretty sure I needed and they seem to work (I only ran them on my test machine as a script - no errors but I haven't double checked that they actually did what they were meant to). I'm still having issues though.

But first to answer a question you asked Adrian: it seems clear that the reason Knowledgetree isn't compatible with 10.04 is because it relies on php5.2 (rather than 5.3) as you thought.

To do a manual install seems to be relatively minor after installing the packages. Its a simple case of running the (web based) "Install Wizard". Most of it is click through with very little real content required from users. From what I've gathered the main thing it does is set up the MySQL stuff and double check everything is ok (giving lots of nice reassuring green ticks).

So part of part of what I need to do to stop the "Install Wizard" (setup.php) from running (which isn't at all required because everything is taken care of in conf now) is run upgrade.php. From what I understand, this tricks KnowledgeTree into thinking that its already been installed and this is just an upgrade to make sure everything is ok - and set the setup.php to not run. Unfortunately though it doesn't seem that I can run php from bash without php-cli (someone please correct me if I'm wrong). To install that requires php-common & php-cli (and quite possibly more dependancies) for php5.2 - there lays my problem :(

I guess perhaps I need to disect upgrade.php and see what it actually does. Out of interest, I tried loading it in a browser and it asks for a username and password but won't accept the default (admin/admin). I'm guessing that there's a step that hasn't occurred yet to set that password? Or perhaps there's something I've missed when doing the SQL stuff? Anyway too tired now...

Jeremy Davis's picture

I'm not sure where to go from here...

To continue completely patching KnowledgeTree so it is preinstalled on TKL Lucid it seems I may need to install php (although I haven't given up yet). Unfortunately the native version in Lucid is 5.3 (which is incompatible with KnowledgeTree - it requires 5.2). Trying to install the native 5.3 results in KnowledgeTree being uninstalled. So I don't know where to go with this.

Perhaps this appliance just needs to stay based on Hardy (or Debain Lenny?) until KT is updated to a version that runs on php5.3? The only other option that I can see is to install (hack) 5.2 into Lucid, which I'm guessing TKL devs wouldn't be keen to do.

I suspect that this may be something that will need some further consideration. I don't think this will be the only appliance that this situation effects. My reading suggests that Drupal 6 is not ready for php5.3 - or more precisely a lot of the plugins aren't ready for php5.3. But perhaps I'm missing something?

Any ideas how this will be best tackled? Especially keen for comment from Liraz and/or Alon!?! :)

Alon Swartz's picture

Firstly, congrats on getting this far - KT seems like a behemoth!

I took a quick look at the KnowledgeTree wiki, and it seems that 5.3.2 is supported - maybe they haven't updated the debian package dependencies. If it's just a mis-configured dependency, maybe we can fork the package.

OTOH, it might be easier to just install from the source tarball? Have you considered it?

Regarding the other appliances and php5.3.2 - I came across some minor issues with extensions in mediawiki but worked around them. I didn't come across any in drupal6 in my limited testing.

If KT doesn't support 5.3.2 at the moment (though they say they do), they will in the future. I'd rather not forward-port packages to Lucid.

Jeremy Davis's picture

Firstly thanks for the encouragment, although I think I'm probably making it look a whole lot harder than it really is. :)

Also your comments give me lots to think about.

I'll have a bit more of a look on the KnowledgeTree site. It has been a while since my initial investigations (although I am using their repo and all of their custom php packages are still php5.2-blahblahblah). If my investigations are correct and they don't currently support 5.3 then I'm sure its only a matter of time, so I completely understand your lack of desire to forward-port old packages.

I'll also have a look at the tarball. I liked the idea of using their repo (so the appliance could be updated easily) but that may be a better option for now (we can always do a repo based version on a later TKL release once they have their act together).

Jeremy Davis's picture

From my searching on the KT website, in places it states that php5.2 is a requirement however it also says elsewhere that it runs ok on 5.3 (although that seems mostly relevant to Win users). After searching deeper I have discovered that it is the Zend Server (which KT runs on top of, from what I can gather it uses Zend to accelerate php) which installs all the php5.2 stuff. The Zend repos also contain 5.3 packages but the issues seem to arise because of the way KT & Zend interact on install (or probably more correctly; the way Zend misbehaves).

In a clean install, zend-server-ce-php-5.3 installs quite happily. However when I attempt to install knowledgetree-ce on top it complains that:

The following packages have unmet dependencies:
  knowledgetree-ce: Depends: zend-server
E: Broken package

However if I try to install zend-server I get this:

Package zend-server is a virtual package provided by:
  zend-server-php-5.3 5.0.0+b17
  zend-server-php-5.2 5.0.0+b14
  zend-server-ce-php-5.3 5.0.0+b13
  zend-server-ce-php-5.2 5.0.0+b15
You should explicitly select one to install.
E: Package zend-server has no installation candidate

It appears that under default conditions (ie install knowledgetree-ce and let it sort out its own dependancies) it will automatically install the php5.2 version of Zend because of some bug with the Zend packages.

Also, apparently the Karmic dependancy (libmysqlclient15) is a bug in the Zend deb too. I have read that it will run fine under libmysqlclient16 (the Lucid package) but unless hacked it expects the Karmic package as a dependancy.

Adrian Moya's picture

Install zendserver from official packages (If I understood you correctly, it will install 5.3 ver) and try to deploy KT tarball... I'll download the tarball and take a look to better help you on this. I'm currently stuck with a Clipbucket patch which doesn't want to detect some codecs, and there is not much help from their community. I also got stuck (but haven't retake the job from a while) on a Zennos patch with a deb that hangs at the end of installation. I've also came across some bugs on the TKLClientCore. I tell you this just to let you know it happens, it requires patience to make it work. You're doing well, this is not a trivial patch. 

I think of patching as resolving a sudoku. I think that's why I like it so much. It's a puzzle. And you can mess it all and have to start over. But once it's ready the satisfaction is great.

I'll came back with some advise when I have the tarball. I think for apps that doesn't support php 5.3 the best way to go would be install php 5.2 from source. But I haven't check how hard would that be.  

Jeremy Davis's picture

I think the KT tarball will be the way to go. Hopefully then the only non-Lucid dependancy will be the libmysqlclient package from Karmic. I'll have a play with the KT tarball too when I get home.

This looks a little outdated (relates to KT v3.5.x - current stable is v3.7.0.2) but may be useful?

Jeremy Davis's picture

I have created a v0.6 patch but have scrapped it (and haven't bothered uploading) for now as installing from tarball on Zend Server CE php5.3 is givning me more problems than I had before.

The KT WebUI 'installer' is saying that there is a required php extension that is unavailable "XMLRPC - Used with XML-RPC servers and clients. - Missing required extension: XMLRPC" I tried installing php5-xmlrpc but that didn't make any difference.

Also it says: "Your version of PHP must be between 5.0 and 5.2 to run optimally. Versions that are 5.3 or higher are not recommended... You are running version 5.3.3."

I've had a bit more of a look at Zend Server php5.2 and it seems that the libmysqlclient15off package is in the Zend repo (so no need to install the Karmic version of that package - although I haven't tested) which is something. The other thing is that the only thing that seems to break (other than being able to run php at the command line) is phpMyAdmin. That may not be a big deal with this appliance? (All the other php5.2 packages are supplied from teh Zend Server repo).

This still leaves us back where we were - unable to completely avoid the WebUI 'Install'. If the mysql db is setup (which I have done successfully from the conf), the WebUI 'Installer' really only checks everything is ok prior to letting you log in for the first time. Looks like the only way forward may be for me to get my hands dirty and learn to read some php!

After mucking around a fair bit today, I'm thinking that the deb repo version may be the best way to go. I think I'll go back to that approach... tomorrow maybe...?

Adrian Moya's picture

So, you think zendsever5.2 (from zend repos) and KT tarball would be the way to go? Does the appliance need the php-cli? if you need to run a php page you could simply wget it (wget http://localhost/page.php) and that would "execute" that page. 

Let's do something, tune the patch to get it to the point where running the installer would make this appliance complete. I'll finish the installation part studying the code. And we share the fame & glory :D (and leave a bit to Basil for his lamp patch, which BTW I'd remove mod_ruby).

Jeremy Davis's picture

I am just about to give the initial post a major cleanup and upload my knowledgetree-0.7 patch. It still has a few minor things that need to be done before I will call it finished (I will provide more details in the initial post) but it works! KT-CE fully installed - ready to go!! :)

It installs KT-CE v3.7.0.2 and all of it's dependancies from repos (standard Lucid + Cannonical partner + KnowledgeTree-CE + Zend Server - no need for the Karmic deb) and so it will apt-upgrade as required. It uses Zend Server php5.2 (from Zend Server repos) which means that phpMyAdmin won't work but thats not an issue for this device IMO. Also it no longer uses Basil's LAMP patch as I discovered the KT deb happily sorts out all its own dependancies including Apache2 and MySQL so no need for it really.

As I say it still needs the finishing touches but I'm so happy! :)

For the record how I solved my final issue was so simple that I should have thought of it before! I copied the KT directory (in /var/share/knowledgetree-ce/) prior to running the WebUI "Install Wizard" and then ran a diff against it after completeing the "install". Then just to be sure I rinsed and repeated, but this time did all the behind the scenes stuff at the commandline (and added the diff changes) and ran the WebUI "Upgrade Wizard" and did a dif again. All these changed files I put in the overlay. Then I discovered that the install overwrote these important files so I rejigged my tklpatch conf so most of it ran pre-overlay and voila!

Sorry , these days I'm too busy at office. so I was unable to involve in TKL forum.  I'll try the patch soon and will post feedbacks here in this thread.

Jeremy Davis's picture

It means a lot getting congrats from the 2 TKLPatching Superstars! :) If it wasn't for your and Adrian's encouragement I would've given up ages ago.

As I said it isn't quite finished but KT seems to work ok (although to be honest I haven't tested it very much).

Adrian Moya's picture

I'm glad you did it! It sounds very good and done the right way (no mixing dist repos). The diff technique assures nothing escapes without knowing. I hope to see it posted soon! Welcome to the club! If you've done this medium level patch, you're ready for bigger challenges! Once you make two or three, you'll see it makes easier and easier... And when you try my tkldevenv, you'll want to develop more and more patches! ;) hahahaa (I'm selling it, I need beta testers)

Waiting for the final post... Kudos!

Jeremy Davis's picture

Thanks again for all the encouragement Adrian. In the end it wasn't actually as hard as I was making it!

I haven't comprehensively tested KT yet (only just logged in) so its possible there may still be some bugs and/or functions that aren't enabled that probably should be. But I'm still pretty chuffed with myself! :)

Now I've got that bit done, I can put a bit of effort into refining it a little and sorting out the other minor things I want to add (as listed in the first post) and hopefully have a final release soon.

As for your TKLDevEnv - I really like the idea of your TKLPatching "workbench" patch and will definately help you test it. I've just been very focused on this patch for a while now (and when I haven't been I haven't wanted to think about TKLPatching)!

I've been watching this thread have been eager for the moment it just comes together. I'm gonna dig in as soon as I can. And thanks for the great documentation - a great learning experience for me too as I tried to keep up.

Jeremy Davis's picture

KT won't allow a normal user to upload a document (I haven't double checked with an admin user but I'd assume that wouldn't work either). It seems to be a simple permissions issue. The KT document storage root folder (/usr/share/knowledgetree-ce/var/Documents) has root ownership. If that is changed to www-data then it all works.

My question is, is it ok to do that? Or should I move the default KT Document storage root folder somewhere else? If so where would be the appropriate spot?

Other stuff I've played with seems to work (and survive reboot), but should I just grant owbership to the whole KT install folder (/usr/knowledgetree) just to be on the safe side? Or is there some other thing I should do here?

I guess bottom line is, I don't just want it to work, I want it to work and work properly, with no bodged up bits! :)

From my understanding, changing ownership to www-data on that directory looks ok...but prolly look for confirmation from others? That's how we've done web apps in the past. Look forward to hearing from others.

Adrian Moya's picture

with changing the folder ownership. But review the documentation regarding this point. Many applications that write to disk ask you to change permission for those folders to 777 or 755. And it tells you which directories to change. KT must have something like that. But changing ownership for the folder seems to be the best way. 

Jeremy Davis's picture

Just tidied up a few loose ends. There are still a couple of things I'd like to do really - like force https, at least for login and admin page. But that will do for now, I think the basics are all there. See the top post for full details. Further feedback warmly welcome. 

nordge1's picture

I am trying to install this patch. I have installed it to an iso and inside a core VM. I am using 11.1 Core. I get the following output from the patch.

 

root@core ~# tklpatch-apply / knowledgetree-0.8.tar.gz
TKLPATCH_ISOLABEL: knowledgetree-0.8
# extracting patch knowledgetree-0.8.tar.gz to /tmp/tmp.sgBJYLmCAQ
# applying patch /tmp/tmp.sgBJYLmCAQ/knowledgetree-0.8
# executing config script /tmp/tmp.sgBJYLmCAQ/knowledgetree-0.8/conf/pre-overlay
# chroot execute: /tmp/tklpatch/pre-overlay
++ dirname /tmp/tklpatch/pre-overlay
+ cwd=/tmp/tklpatch
+ source /tmp/tklpatch/functions
+ HOSTNAME=knowledgetree
+ echo knowledgetree
+ sed -i 's|127.0.1.1 \(.*\)|127.0.1.1 knowledgetree|' /etc/hosts
+ byobu-launcher-uninstall
/tmp/tklpatch/pre-overlay: line 18: byobu-launcher-uninstall: command not found
 

I'm not certain which script to edit to fix this. Any ideas what's happening?

Thanks

Jeremy Davis's picture

I'll update it and reupload as soon as I get a chance (today hopefully).

But in the meantime, the error is caused because this patch was based on the old v11.0beta which included byobu. Byobu has since been removed (since v11.0RC from memory) so the command is no longer recognised. If you wish to work around it you can edit the script and comment out the offending line (ie put a # in front of it).

PS from memory it's the pre-overlay script that you'll want to edit.

Jeremy Davis's picture

I have removed the offending line and repackaged and reuploaded the patch. I haven't actually tested it though (a bit naughty really) so please let me know if you encounter any further issues.

Jeremy Davis's picture

I am currently uploading a prebuilt ISO to SourceForge (and I also plan to upload an OVZ template soon too). Have a look here (should be available really soon).

Jeremy Davis's picture

The patch itself probably needs an update now anyway. Besides I've learned a lot since I made this patch (it was my first - as you may have read above, so perhaps I can do it better?).

I was also having a few issues with the OVZ conversion process, but (with the help of Adrian) I have it running smoothly now. So smoothly in fact that Alon (one of the core TKL devs) has used it as the basis for creation of official TKL OVZ templates.

So bottom line; I will create this as a template on this existing patch (which should still work ok) asap and upload it. But I will also look at updating the patch sometime soon too.

I'd also really like to develop a script so you can apply patch directly to OVZ templates (which will be handy as there are now official OVZ templates). But that's another story...

PS if you haven't seen any activity here within the near future, don't be scared to give me a nudge (by way of a bump).

Jeremy Davis's picture

Hey there.

I have completed the re-write of this patch (which was the first one I ever made and was sadly in need of some lovin!) and I must say I'm pretty happy with it. I decided to start a new thread seeing as this one has been around for a while. So head over here for a look.

I have used it to patch an ISO and an OVZ which I have briefly tested both of. They will be uploaded to SF asap.

Hope they work out for you and I'd love to hear some feedback (but probably may as well do that on the new thread).

Jeremy Davis's picture

The docs look pretty good. So start here. That should give you an idea of what you'll need. Most (if not all) of the prerequisites should be already installed (for KT) although you'll probably have to much around with the virtual host to get it to work how you want.

Jeremy Davis's picture

As you may or may not be aware, KnowledgeTree have canned their Community Edition, closed their forums, wiki 'forge' (where the community used to be able to share plugins and additional features) and their public Debian/Ubuntu repo. And unfortunately their 'open source' licence is a scam IMO.

Under their 'open source' licence you are free to use the code for your own purposes but under the terms of their licence you can't distribute under a different name or without their logo; but conversely you are not licenced to use their logo if the code is altered.

When I first discovered this I thought those banging on about it were being alarmist, but as can be seen, they weren't...

In effect this means that whilst technically KnowledgeTree is Open Source, it is not FOSS (Free Open Source Software). There is no avenue to fork the existing code and release it under a new name and now they no longer distribute the code there is no way to recieve security (or other) updates. The only way to have the current version of KT now is to purchase their hosted SaaS version.

This all means that there is and never will be an official, stable TKL KnowledgeTree appliance. I think that this is a huge shame as IMO KT is/was a great product and I really feel for the community members that created and supported additional features and IMO their work has been 'stolen' by KT by making their software SaaS only...

So whilst you can still legitimately download my last patched version of KT appliance (from SourceForge here - in both ISO or OVZ template) I strongly suggest that you investigate another Open Source Document Management solution. There are a number of ones available (have a look on SourceForge here).

IMO one of the closest ones to KT feature wise is Alfresco. AFAIK unfortunately there is not a current TKLPatch for Alfresco (Alfresco is 64 biit only and TKL only has a RC release of 64 bit) although there has been some discussion on the idea. FWIW I have successfully installed it to the TKL v13.0RC and am using it at work. One of the huge advantages of Alfresco (over KT) is that you can access the Doc repo via CIFS/SMB (Windows file sharing) although I haven't thoroughly tested this feature yet.

Jeremy Davis's picture

Although I'm not sure about v3.5. v3.7 that I downloaded and included in my patch was definately not under GPL... I was under the "KnowledgeTree Open Source Licence", which was only just Open Source...

But if you can get a copy of the code that is clearly under GPL and have the skills and desire then you could definately fork it. Which IMO would be great.

Personally I'm pretty happy with Alfresco

Jeremy Davis's picture

This thread is really old and no longer relevant. As it's attracting a few spam posters, I'm going to lock it. Please feel free to comment elsewhere or ideally, sign up and start your own thread.