Here are instructions for running Cyklotron2 starting with a plain Linux machine without development tools installed.
Note! you need root privileges to create directories under /usr/local directory.
1. Installing Java SDK
Go to http://java.sun.com/j2se/1.4.2/download.html, Choose "Download J2SE SDK", accept licence, Choose "Linux Platform", "self-extracting file". Save the file somewhere (~ or /tmp will be fine), and execute it with:
sh ./j2sdkversion.bin
Directory named j2sdkversion will be created in the current directory. Move it to /usr/local/j2dskversion, and craeate a symlink:
ln -s /usr/local/j2sdkversion/usr/local/java.
Add the following line to the end of your ~/.bashrc:
export JAVA_HOME=/usr/local/java
2. Prepare application sandbox and basic configuration
Create application home directory $APP_HOME i.e. '/home/cyklotron2'
Create webapp directory $WEB_APP in $APP_HOME i.e. '/home/cyklotron2/webapp'
Create config directory $CONFIG in $WEB_APP directory i.e. '/home/cyklotron2/webapp/config
Download cyklotron2-webapp.war and cyklotron2-initial-data.sql into $APP_HOME directory
3. Tomcat installation and configuration
Get newest Tomcat application server version 5.5.x from http://jakarta.apache.org
Unpack it to some directory that we will called $CATALINA_HOME
Add application descriptor cyklotron2.xml to $CATALINA_HOME/conf/Catalina/$SERVER_NAME/
Use template to create your own descriptor:
$APP_CONTEXT_NAME is an application name in servlet container.
Use i.e. 'cyklotron2' name to distinguish Your application from the other installed in Your servlet container.
You can get rid of application context by setting empty '' context. In this case be sure that there are no other applications configured in container.
$SERVER_NAME this is the name of your network server name.
4. Tomcat - Apache integration
Mod-jk installation
To integrate Tomcat container with Apache You need mod_jk connector.
You can install it from a standard package i.e. libapache2-mod-jk (Debian unstable, Ubuntu Dapper...)
or get binaries from http://tomcat.apache.org/connectors-doc/.
If binaries or packages are not available for your system you'll have to download connector sources and compile it on your own.
Follow the instructions on this page http://tomcat.apache.org/connectors-doc/howto/apache.hmtl
Here you have compiled version of mod_jk module dedicated for Apache ver. 2.0.54.
mod_jk_2.0.54.tar.gz
In case of manual installation copy mod_jk.so file to apache2 modules directory (i.e. /usr/lib/apache2/modules - Ubuntu)
Copy rest of the files into apache2 available modules directory (i.e. /etc/apache2/mods-available).
Those files should look like these below:
Create symlinks to mod_jk.conf and mod_jk.load files in apache2 enabled modules directory (i.e. /etc/apache2/mods-enabled)
to enable mod_jk module:
ln -s /etc/apache2/mods-available/mod_jk.load/etc/apache2/mods-enabled/mod_jk.load
ln -s /etc/apache2/mods-available/mod_jk.conf/etc/apache2/mods-enabled/mod_jk.conf
Create your site configuration in apache2 available sites directory (i.e. /etc/apache2/sites-available)...
...and enable it by creating symlink in apache2 enabled sites directory (i.e. /etc/apache2/sites-enabled):
ln -s /etc/apache2/sites-available/my_virtual_definition/etc/apache2/sites-enabled/my_virtual_definition
Be sure the $SERVER_NAME in apache, mod_jk.workers and tomcat are the same and
tomcat is configured to listen on port declared in mod_jk.workers file (8009 by default).
5. Database configuration and initialisation
Install database engine
To use Cyklotron you have to install PostgreSQL database engine.
To ensure proper operation of Cyklotron, You need to install the JDBC driver jar (for Your PostgreSQL version) into $CATALINA_HOME/shared/lib directory. For instance on Fedora Linux installations the JDBC driver jar for PostgreSQL is packaged in postgresql-jdbc rpm and can be found in /usr/share/java/ directory.
Configure database connection
The default configuration of database connection for Cyklotron is stored in org.objectledge.database.XaPoolDataSource.xml configuration file
delivered within application war.
The following section of the file will tell You about the user name and database name used by Cyklotron.
The cyklotron2 is the database name, cyklotron is the user name and coraltest is the password. Of course You may change these values to suit Your needs. You can do it by placing a modified copy of the aforementioned configuration file in $CONFIG directory of Your webapplication.
Configure database engine
After configuring the database connection You will have enough information to configure the database engine to work with Cyklotron.
First You have to create a database user named as in the configuration file. Than this user has to be allowed to create databases. Than create the database for instance using the following command (under Unix/Linux):
createdb -U <username> -E UNICODE <dbname>
You must also remember that PostgreSQL JDBC driver requires TCP/IP connection to the database and by default PostgreSQL is not configured to accept them.
More information about PostgreSQL can be found in PostgreSQL Manual.
Init database
When everything concerning the database is configured properly,
load database with initial data:
psql -U <username> <dbname> < cyklotron2-initial-data.sql
If operation finishes with success, the database should be already prepared!
Configure default locale
The application ready for localization however right now it contains only two languages available.
The default configuration of Cyklotron i18n subsystem is stored in org.objectledge.i18n.I18n.xml configuration file
delivered within application war.
Choose default locale by setting default attribute in selected locale. By default the en_US locale is chosen.
6. Running tomcat
Go to $CATALINA_HOME/bin directory and execute ./catalina.sh run
Now you can type in your browser navigation bar: http://$SERVER_NAME:$PORT/$APP_CONTEXT_NAME/
Thats all - have a fun!
See also Post installation application tuning to polish your application and open it to the audience.
