SWI Server‎ > ‎

SWI Server Installation

SWI server is a web application developed in java on tomcat web server. It uses Cassandra as datastore.

- Install required open-source components:

1. Install java1.6

Set environment variable $JAVA_HOME. Add $JAVA_HOME/bin to $PATH.

2. Install tomcat5.5

Set environment variable $CATALINA_HOME.

3. Install cassandra0.6

See http://cassandra.apache.org/ for instructions.

For example, create cassandra home and data directories:
  /app/cassandra/bin
                /conf
                /log
  /data/cassandra/commitlog/
                 /data/

Set environment variable: CASSANDRA_HOME=/app/cassandra

edit bin/cassandra.in.sh:
-Dcom.sun.management.jmxremote.port=8081

edit conf/log4j.properties:
log4j.appender.R.File=/app/cassandra/log/system.log 


edit conf/storage-conf.xml:
 <CommitLogDirectory>/data/cassandra/commitlog</CommitLogDirectory>
 <DataFileDirectories>
     <DataFileDirectory>/data/cassandra/data</DataFileDirectory>
 </DataFileDirectories>

run from cassandra home:
$ bin/cassandra -p pid
$ kill `cat pid`   (or bin/stop-server )

- Install swi server:

The steps here are tested on windows with cygwin and on linux. For windows users, install cygwin first.

1. Unpack swiserver-package-#.jar in a directory where you want to install swi server. For example, in directory /app, this will create swiserver home directory: /app/swiserver.
  $ jar xvf swiserver-package-#.jar

2. Set environment variable $SWI_HOME to swiserver home directory, e.g. /app/swiserver.  It's required by running scripts. 

3. Setup log property file <swiserver>/conf/log4j.properties: Set log.dir to /app/swiserver/logs for example.

4. Edit swi server configuration file <swiserver>/conf/cis.properties:

Set correct path to the log property file, e.g. log4j_file=/app/swiserver/conf/log4j.properties
Set server host url, e.g. host.url=http://localhost:8080
Set default admin password, e.g. admin.pwd=mypassword.  (After logging in and creating admin account, you should empty the admin.pwd here.)
Set email smtp server.

5. Copy and paste the keyspace definiation for swi server from <swiserver>/conf/cis-keyspace.txt into the <Keyspaces> block in file <cassandra>/conf/storage-conf.xml.

6. Copy swiserver.war to tomcat's webapps directory.

7. To start swi server, start cassandra and then tomcat. Check log messages to make sure swi server starts correctly. (If bin/startup.sh fails to recognize $SWI_HOME and $CATALINA_HOME, set them directly in the script.)

  $ cd <cassandra>
  $ bin/cassandra -p pid 
  $ <swiserver>/bin/startup.sh
  $ tail -f <swiserver>/logs/cis.log

8. Setup admin account for the first time:

Open admin login page, e.g. http://localhost:8080/adminlogin.
Log in with the default admin user and password set in the cis.properties file. After log in, you should create an admin user account with admin role.  

9. To stop swi server, stop tomcat. (If bin/shutdown.sh fails, set CATALINA_HOME in the script.
$ <swiserver>/bin/shutdown.sh

10. To stop cassandra:
  $ cd <cassandra>
  $ bin/stop-server
 
Please let us know if you need help.

Comments