Sunday, March 16, 2014

PartKeepr installation on Ubuntu (or Kubuntu)


For my personal electronics components management, I installed PartKeepr. This article details steps required to install it on Ubuntu/Kubuntu. I've the tried the steps on both Ubuntu 12.10 and Kubuntu 12.04, both desktop version.

 

What is PartKeepr?


PartKeepr (www.partkeepr.org) is an open source inventory manage system, primarily designed for electronic components. 
I generally lose track of my (however small) personal inventory of electronic components. Also, some important components may be in use in some projects. This is where PartKeepr comes in! It fulfils most of my requirements for a Small , Personal Inventory Management System for  Electronic Components.

Some of its features I like are:
  • Electronic Components Management
  • Projects and Components currently in use by them
  • Label Printing
  • Intuitive UI, although I'd like more fast and better UI 

PartKeepr Demo @  demo.partkeepr.org

 

Installation


1. Install apache, mysql, php, imagemagick
sudo apt-get install apache2 mysql-server mysql-client libapache2-mod-php5 php5-mysql php5-curl php5-cli php-pear php5-imagick php5-xsl php-apc php5-dev imagemagick git

2. Download, extract, copy to /var/www and set correct permissions
wget http://partkeepr.org/downloads/partkeepr-0.1.9.zip
unzip partkeepr-0.1.9.zip
sudo cp -r ./partkeepr-0.1.9 /var/www/
sudo chmod -R 777 /var/www/partkeepr-0.1.9/

3. Update PEAR
pear update-channels
sudo pear upgrade

4. Install phpunit, phing, doctrine components and twig. During the installation, it could happen that the ImageMagick library gets pulled in via PECL. Just hit enter on each question and ignore if it fails; as long as you've got php5-imagick installed, you're set.

pear config-set auto_discover 1
sudo pear install pear.phpunit.de/PHPUnit pear.phpunit.de/phpcpd pear.phing.info/phing pear.doctrine-project.org/DoctrineORM pear.doctrine-project.org/DoctrineSymfonyYaml pear.doctrine-project.org/DoctrineSymfonyConsole pear.twig-project.org/Twig
sudo pear install --alldeps phpmd/PHP_PMD-alpha


5. We also need jsl, the JavaScript lint

sudo apt-get install nodejs
sudo apt-get install npm

npm config set registry http://registry.npmjs.org/
sudo npm install -g jslint


6. From the browser, go to  http://localhost/partkeepr-0.1.9/setup/ and click Next



7. In the prerequisite check, I got "You are missing the GD library for PHP. Please install and activate it.".

So to install GD Library, install php5-gd
sudo apt-get install php5-gd

8. Click Re-run checks. Now, again I got "The PHP timezone () is not set or invalid. Please set the correct timezone in your php.ini file (don't forget to restart the web server afterwards)".


So, set the correct timezone in php.ini 
sudo nano /etc/php5/apache2/php.ini
Uncomment "date.timezone =" and set timezone ap per the supported timezones (here: http://in3.php.net/manual/en/timezones.php)

For example :   date.timezone = UTC

Save the file and restart the apache server:
sudo /etc/init.d/apache2 restart
Now, again Re-run Checks. This time I got all success. Click Next



9. Now, we have to create a database for PartKeepr, you can either use the form to get the desired commands for creating database or, simply enter the commands below in your shell:
mysql -uroot -p
CREATE DATABASE partkeepr CHARACTER SET utf8;
grant usage on *.* to partkeepr@localhost identified by 'partkeepr';
grant all privileges on partkeepr.* to partkeepr@localhost;
quit


10. Now, fill the form as in screenshot and click next:



11. If Database Connectivity Test is OK, then proceed.



12. Wait till the PartKeepr installation is  set-up, then click Next:






13.  Save the configuration either through browser (if it is writable) or manually. I selected 1st option and the file got saved successfully:



14. The next step is to setup Cron jobs:
crontab -e
If it asks to select your editor, select anyone of your liking.
Enter the commands as shown in screenshot of Installation and Console:
0 0,12 * * * /usr/bin/php <path-to-partkeepr>/cronjobs/CreateStatisticSnapshot.php
0 0,6,12,18 * * * /usr/bin/php <path-to-partkeepr>/cronjobs/UpdatePartCacheData.php
0 0 */2 * * /usr/bin/php <path-to-partkeepr>/cronjobs/CheckForUpdates.php
0 0 */2 * * /usr/bin/php <path-to-partkeepr>/cronjobs/UpdateTipsOfTheDay.php

 Save the file.




15. Return to Browser and click Next. It should tell that setup is complete.



16. Go to http://localhost/partkeepr-0.1.9/frontend/ and login. Default username/password is admin/admin:



17. And Voila!, you now have a working PartKeepr Installation! Congratulations!



Links I consulted for PartKeepr Installation:
1. https://github.com/partkeepr/PartKeepr/blob/master/documentation/developer/INSTALL-UBUNTU
2. http://www.cyberciti.biz/faq/ubuntu-linux-install-or-add-php-gd-support-to-apache/
3. http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job

4 comments:

  1. Very good tool.Nice to manage the parts and look up for them instead of searching under pillow without any dividends.Only one minute suggestion though.Please align the images with text inline.

    ReplyDelete
  2. default target apache2 change from /var/www to /var/www/html Ubuntu 14.04

    ReplyDelete
  3. Does it provide password protection? Can it be accessed on remote location, if it is stored in server? Can we access on Windows platform on remote location even though it is linux based on server? Can we get same software for Windows platform?

    ReplyDelete
  4. http://localhost/partkeepr-0.1.9/setup/%20and%20click%20Next
    Not found didn't got this

    ReplyDelete