KonaKart Integration

KonaKart is a Java based eCommerce Shopping Cart Software.

KonaKart supports various databases, but the following step-by-step instruction is based on PostgreSQL (and MySQL)

Install PostgreSQL on a Linux server

  • uname -a
  • sudo bash
  • aptitude search postgres
  • aptitude install postgresql-8.2
  • ls /var/lib/postgresql/8.2/
  • /etc/init.d/postgresql-8.2 stop
  • /etc/init.d/postgresql-8.2 start
  • su - postgres
  • psql -U postgres
  • List/show all databases contained by this instance: select * from pg_database;
  • select * from pg_tables;
  • \q

Install PostgreSQL on Mac OS X (Snow Leopard)

  • http://www.postgresql.org/download/macosx
  • sudo bash
  • su - postgres
  • In the case of 9.0 one has to init the DB after installing, e.g. /Library/PostgreSQL/9.0/bin/initdb -D /Library/PostgreSQL/9.0/data
  • /Library/PostgreSQL/8.4/bin/pg_ctl -D /Library/PostgreSQL/8.4/data stop
  • /Library/PostgreSQL/8.4/bin/pg_ctl -D /Library/PostgreSQL/8.4/data start

Install MySQL on Mac OS X (Snow Leopard)

  • http://dev.mysql.com/downloads/mysql/
    • Download Community Server DMG Archive: mysql-5.1.47-osx10.6-x86_64.dmg
  • Open DMG
    • Double-click mysql-5.1.47-osx10.6-x86_64.pkg
    • Will be installed to /usr/local/...
    • Double-click MySQLStartupItem.pkg
    • Will be installed to /Library/StartupItems/...
  • sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
  • sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
  • In order to disable automatic startup during system boot: vi /etc/hostconfig (set MYSQLCOM=-YES- to NO)
  • Test mysql: /usr/local/mysql/bin/mysqlshow -uroot -p
  • Display version: /usr/local/mysql/bin/mysqladmin version
  • Import MySQL dump:
    • /usr/local/mysql/bin/mysql -uroot -p < /Users/michaelwechner/dump.sql
    • The initial root account passwords are empty, hence just hit enter when being asked for the password
  • Assuming that the dump created a database called 'my-database', which contains a table 'my-table':
    • /usr/local/mysql/bin/mysql -uroot -p my-database
    • show tables;
    • select * from my-table;
    • quit
  • ...

Install KonaKart

Import KonaKart sample data into PostgreSQL

  • Create a KonaKart database within PostgreSQL:
    • sudo bash
    • /etc/init.d/postgresql-8.2 start
    • su - postgres
    • dropdb -U postgres konakart
    • createdb -U postgres --encoding unicode konakart
  • Import the sample data (e.g. a dump):
    • Depending on what web-server port you want to run KonaKart, you might have to change the port within the KonaKart sample data:
      • grep 8780 konakart/database/PostgreSQL/konakart_demo.sql
      • Replace the port number 8780 for example by 8080: vi: 1,$s/8780/8080/g
      • grep localhost:8780 konakart/database/PostgreSQL/konakart_demo.sql
      • Replace localhost by the actual server host name
    • Import the data: psql -U postgres -d konakart -f konakart/database/PostgreSQL/konakart_demo.sql
    • Test the data:
      • psql -U postgres -d konakart
      • select * from products;
      • \q
    • ...
  • ...

Configure the database connection within KonaKart and PostgreSQL

  • cd konakart
  • webapps/konakart/WEB-INF/classes/konakart.properties
    • torque.database.store1.adapter              = postgresql
    • torque.dsfactory.store1.connection.driver   = org.postgresql.Driver
    • torque.dsfactory.store1.connection.url      = jdbc:postgresql://localhost:5432/konakart
    • torque.dsfactory.store1.connection.user     = postgres
    • torque.dsfactory.store1.connection.password =
  • webapps/konakartadmin/WEB-INF/classes/konakartadmin.properties
  • Make sure that postgreSQL is listening
    • vi /etc/postgresql/8.2/main/postgresql.conf
    • listen_addresses = 'localhost,127.0.0.1'
    • netstat -nt -l | grep 5432
  • Make sure that you can connect without password from localhost:
    • vi /etc/postgresql/8.2/main/pg_hba.conf
    • host    all         all         127.0.0.1/32          trust
    • host    all         all         ::1/128               trust

Running KonaKart

  • Either run the Tomcat which is part of the distribution
    • cd konkart
    • OPTIONAL: To be on the safe reconfigure the port 8005 within conf/server.xml by for example 8705
    • OPTIONAL: Enable SOAP: webapps/konakart/WEB-INF/server-config.wsdd (<parameter name="allowedMethods" value="*"/>)
    • chmod -R 775 bin
    • ./bin/startup.sh
    • http://127.0.0.1:8780/konakart/
    • SOAP: http://127.0.0.1:8780/konakart/services/KKWebServiceEng
  • Or build war files
    • cd konakart/custom
    • ant make_wars
    • cp war/* MY_TOMCAT/webapps/.
    • OPTIONAL: Make sure that database connection is configured correctly (as described above)
  • Frontend: http://127.0.0.1:8080/konakart/
  • Backend: http://127.0.0.1:8080/konakartadmin/

Alternative: Use the silent installer on Linux (WARNING: Does not work on Mac OS X)

  • Download the Linux installer: http://www.konakart.com/downloads/community_edition
  • ./konakart-linux-install -S -DInstallationDir /home/wyona/konakart -DDatabaseType postgresql -DDatabaseUrl jdbc:postgresql://localhost:5432/konakart -DDatabaseDriver org.postgresql.Driver -DDatabaseUsername postgres
  • Startup: It seems that the silent installer starts Tomcat automatically on port 8780
    • netstat -nt -l | grep
    • http://195.226.6.73:8780
    • Otherwise use /home/wyona/konakart/bin/startup.sh
  • IMPORTANT: Make sure that your data within the database is also using the port 8780

Installing the Enterprise Edition (manually)

  • Also see http://www.konakart.com/docs/manualInstallation_EE.html
  • Assume we have installed the community edition at /home/foo/konakart
  • ./bin/shutdown.sh
  • Unzip konkart enterprise package (e.g. KonaKart-Enterprise-4.2.0.1.zip) within some temporary directory, e.g. /home/foo/tmp/konakart
  • Copy (overwrite) all files and directories from the enterrpise to the community directory, e.g. cp -r /home/foo/tmp/konakart/* /home/foo/konakart/.
  • ./bin/startup.sh
  • Try using a feature which is only supported by the enterprise edition, e.g. switching the language within konakartadmin.

Help

Misc



Your comments are much appreciated

Is the content of this page unclear or you think it could be improved? Please add a comment and we will try to improve it accordingly.